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?

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.

  • 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. Feb 1, 2013 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, 2013 at 5:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .