Take the 2-minute tour ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

Does debug log add up to the Apex heap size? I had enabled debug logs with some specific debug filters in place and immediately hit the Apex heap size limit, when I turned it off the apex ran without hitting the limit. I couldn't find any documentation about debug logs contributing to the apex heap size. Has anyone experienced this?

share|improve this question
add comment

1 Answer 1

No it should not, only variables you create in your Apex code contribute to it. In order to prove this, can you adjust the data volumes / records your code is consuming such that it does not hit the heap limit regardless. Then you can refer to the Debug Heap size summary at the bottom of the debug log. If it differs at all, I would say this is a bug and you need to raise a Salesfoce case.

share|improve this answer
    
You can also look in the Developer Console's Execution Tree to get a simple GUI view of how much heap space the debug call is making; however in my Winter '13 DE it just shows zeroes for everything and the actual log states that 0 out of 6000000 have been used, so hard to say. The screen capture in my link above shows zero for the debug calls. –  Peter Knolle Feb 1 '13 at 13:26
    
Yeah, in sandbox the Maximum heap size always reports "0 out of 6000000" (another bug?). Testing in production is not going to be easy so I am going to try getting the heap size from Limit methods, thanks for the replies. –  manubkk Feb 4 '13 at 5:26
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.