Skip to main content

Hi, I have a batch apex that retrieves an object, that will update data in 5 different objects. I am getting heap issue. I used Limits.getHeapSize(); I cleared list after inserting(accList.clear()). In debug log with getHeapSize() shows similar size, not much difference. But in anonymous there is a change.

 

I am unable to find what is the exact heap size, where it get exceeded. Debug logs are of no use. I also tried queueable apex to insert a list and clear it later.

 

How to debug properly for this issue?

#Batchable #Batchapex #Salesforce Developer #GovernorLimits #Apex

2 respostas
  1. 21 de out. de 2023, 16:23

    @AMAN GARG I Created a sample batch apex with perfect optimization. But the issue is, it shows the same heap size in Limits.getHeapSize(); Probably We can say it is async, but how to exactly know where the heap gets exceeded?

0/9000