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
Surya KiranSurya Kiran 

Custom Iterable Batch Apex Error : System.LimitException: Batchable instance is too big

Hi,

We are importing .csv data from visualforce page. CSV  file contains more than 50000 records. I am taking this file from vf page and passing it to batchable class using custom iterator. If the csv file contains below 50000 (some times it might be approx 54000 but not 60000) records it's workig fine. If above 50000 I am getting the above limit exception.

Is there any way to avoid this exception ..?
Best Answer chosen by Surya Kiran
Surya KiranSurya Kiran
Hi Vinita_SFDC,

Thanks for quick reply. I could avoid that exception.

All Answers

Vinita_SFDCVinita_SFDC
Hello,

This issue occurs because of batchable class size exceeded the maximum heap size. Please refer following blog for dealing with heap size limit:

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

https://developer.salesforce.com/forums/ForumsMain?id=906F0000000913rIAA
Surya KiranSurya Kiran
Hi Vinita_SFDC,

Thanks for quick reply. I could avoid that exception.
This was selected as the best answer