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
Laxmaya ChnLaxmaya Chn 

HOW TO SOLVE APEX HEAP SIZE TOO LARGE:9571499 PROBLEM

Hi Dudes
I am getting apex heap size problem while attaching 9 MB file and sending it to my customers in cases; I am able to attach a file up to 25 MB but I am unable to send a file with that size.
Ashish_SFDCAshish_SFDC
Hi , 


1. Don't use class level variables to store a large amounts of data.

2. Utilize SOQL For Loops to iterate and process data from large queries.

3. Construct methods and loops that allow variables to go out of scope as soon as they are no longer needed.

here is the link for SOQL loop

http://www.salesforce.com/us/developer/docs/apexcode/Content/langCon_apex_loops_for_SOQL.htm


Also see, 

Managing the Heap in Salesforce.com

http://blog.jeffdouglas.com/2010/08/16/managing-the-heap-in-salesforce-com/


Regards,
Ashish