I am getting error apex heap size too large in api class
How to reduce the apex heap size in api class there is code for that?
can u help me how to solve this issue.
thanks in advance!
2 réponses
Hi Mohankumar, I'd suggest the following to ensure that you dont hit the heap size limit -
Don't use class level variables to store a large amounts of data.
Utilize SOQL For Loops to iterate and process data from large queries.Construct methods and loops that allow variables to go out of scope as soon as they are no longer needed.
But, if you do hit the limit, here's (https://help.salesforce.com/articleView?id=code_apex_access_via_list.htm&type=5) a help article from Salesforce that outlines some resolution options.
Thanks!
Arun S.