function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Apex heap size too large error

Hi all,


We have written a batch apex class to process a large no of accounts, say 200k+ accounts.

The batch job runs fine upto 30K-35K accounts, but when the accounts records are more than 40K, it throws Apex heap size too large exception.


Have anyone faced this issue before ? please help us with any work around to avoid hitting this limit ...thanks..


Sounds like you may not be re-initializing used collections in the batch. Seeing your code would help :)


I can't access your instance in that manner, you can post the code here if you'd like or contact me via PM otherwise.


Please let me know your email id.


The code exceeds 20K not able to post it .....