+ Start a Discussion
gotherthanthougotherthanthou 

Maximum # of Statements

There is a maximum # of statements that you can execute during a single invocation of APEX.

 

Is there any way to programatically determine how close I am to that imit?  I have a recursive procedure that I want to run until it gets close to the limit and then turn itself off before it triggers an unrecoverable error. (you cannot catch that type of error)

 

While I'm at it I wouldn't mind knowing how close I am to running out of heap and levels of nesting.

Best Answer chosen by Admin (Salesforce Developers) 
mtbclimbermtbclimber