+ Start a Discussion
b-Forceb-Force 

Compile Error : Method exceeds maximum number of allowed op codes......please help

Hello Guys,

 

We are having one huge class , which is around 1500 lines of code in it and contains only one method.

now when we are trying to add any new code in methhod it shows compile error as below 

 

Compile Error : Method exceeds maximum number of allowed op codes, please break this method into multiple ,smaller methods.

 

 

 

Does is there any limit for code length in class function.

 

 

Any help will be apritiated .

 

Thanks,

Bala

 

tmatthiesentmatthiesen

As part of the Winter release we are rolling out a new Apex runtime.  With this new runtime, we are limiting the number of operations in a single method to 65K.  This is an extreme limit and one which is shared by Java.  We are in the process of contacting customers who have hit this.  As this is an extreme limit, there are very few instances of this.  Please send me your org id (tmatthiesen@salesforce.com) and I can take a look.  Our primary goal is customer success and we will work with you to limit any production impact. 

b-Forceb-Force

Thanks a lot for your response,

I will share my Org Id and class name with you, 

 

Regards, 

bForce

Salesforce NewbieSalesforce Newbie

Hello,

 

I also have encountered this error ("Method exceeds maximum number of allowed op codes. Please break this method into multiple, smaller methods.").  The error is being reported as a Test Failure on a dependant class when running an Apex test class.

 

To resolove this issue can you help me determine:

1. How I can measure the number of operations in bytes size?

2. Is there a way I can audit existing classes to determine whether they are hitting this limit or not?

 

 

Thanks,

Nola.

Ismael1981Ismael1981

 

Hi,

I have the same error but only in Full copy Sandbox environment, not in PRODUCTION.

 

How could i solve this?

SrinuSrinu

Hi, 

 

My Sandbox is got refreshed to winter 13. After that, I am getting the below error, when I am  running my test class. Previously It got executed well.

 

Error description:

 

Compile Error : line -1, column -1: Method 'invoke' exceeds the maximum number of allowed op codes. Please break this method into multiple, smaller methods.

 

You have given explanation here in this link.

 

http://boards.developerforce.com/t5/Apex-Code-Development/Compile-Error-Method-exceeds-maximum-number-of-allowed-op-codes/td-p/343135

 

 

How could I solve this?

 

any suggestion would be appreciated..!

 

Thank You,

Srinu