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
Cloud AtlasCloud Atlas 

Heap Size over 12MB

I have a batch job which is currently calling out to an external API for just 1 record  at a time and is getting response back for ALL reords which is over 12 MB.
Can Salesforce do something to chunk the response into smaller uints and process them correctly or does the external API needs to just send the response back for 1 record, instead of sending them all at once??

I think it should be the latter as I don't know any method to do the former.
Please provide some guidance if you happen to know.

Thanks!
Best Answer chosen by Cloud Atlas
SaketJoshiSaketJoshi
Yes, Salesforce cannot do anything to divide the response into smaller chunks. This works for any other system as well. You need to change the way your external API responds so as to send the response only for the single record that you have queried.

All Answers

SaketJoshiSaketJoshi
Yes, Salesforce cannot do anything to divide the response into smaller chunks. This works for any other system as well. You need to change the way your external API responds so as to send the response only for the single record that you have queried.
This was selected as the best answer
Cloud AtlasCloud Atlas
Thanks Saket for the quick response.
I thought the same , and wanted to get a confirmation.
Really appreciate it.