• ShashikantKulkarni
  • NEWBIE
  • 10 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
Hi All,

I am not expecting any code here but just a logic or at least a way to solve my problem.
My requirement is:
I have a batch job, in that I am invoking a class which is looking for a custom object records. The reords could be more than 30000. Now I want to go through each record, do some 'processing' based on values in other fields and then update a value field in the same record. Also during 'processing' step I might look for Account and other standard objects and their field values and use them in my calculation.
The problem in doing this is that I am loading too much data in memory and getting "Apex heap size too large" error.  I tried the suggestions given in some posts on how to update records using list, and load only required data in memory and believe me that I did all that but still getting error as I need to process huge number of records. Is there any other way to do this without getting memory error or without hitting the governor limits?
Hi All,

I am not expecting any code here but just a logic or at least a way to solve my problem.
My requirement is:
I have a batch job, in that I am invoking a class which is looking for a custom object records. The reords could be more than 30000. Now I want to go through each record, do some 'processing' based on values in other fields and then update a value field in the same record. Also during 'processing' step I might look for Account and other standard objects and their field values and use them in my calculation.
The problem in doing this is that I am loading too much data in memory and getting "Apex heap size too large" error.  I tried the suggestions given in some posts on how to update records using list, and load only required data in memory and believe me that I did all that but still getting error as I need to process huge number of records. Is there any other way to do this without getting memory error or without hitting the governor limits?