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
Jeanette Albert 15Jeanette Albert 15 

JSON String Heap Size Limit error when download more records into zipfile

Hello All,

I am an Admin but have lightly worked in APEX.  At my new work they use this custom object "doc control". they can download pdf but if there are over 40 lets say we get the error message below.  Can I fix the code or is this a goverance issue?

To make sense of the numbers below, there are 54 cover pages, 2 letters for each order so 108 pnls, and the difference is 11 “other” doc control (in this case, proofs of insurance or POI).  (54 x 2) PNL + 11 POI=119 documents!

User-added image
R Z KhanR Z Khan
Hi Jeanette,

You can't change the heap size in salesforce. You could modify your code to make sure you process mroe records through your JSON.
Please read a link below to help you reduce the heap size in your existing code. You could also use @future methods to get more heap space


https://help.salesforce.com/HTViewSolution?id=000004186&language=en_US