You need to sign in to do that
Don't have an account?
Baz Denson
Heap size on HTTPResponse
I have some code as follows:
The reaponse body size is returned as 3229916, so when I attempt to create an XMLStreamReader variable, the heap size limit is blown.
Can anyone suggest how I can refactor the code so I don't exceed the 6mb limit?
System.debug('Response Body size is '+response.getBodyAsBlob().size()); XmlStreamReader xsr = new XmlStreamReader(response.getBody()); String result = parseXML(xsr, dealerId);
The reaponse body size is returned as 3229916, so when I attempt to create an XMLStreamReader variable, the heap size limit is blown.
Can anyone suggest how I can refactor the code so I don't exceed the 6mb limit?
Can you parse the XmlStreamReader in async mode like queueable apex etc so that you will 12 mb limit
Execution Governors and Limits: Total heap size Synchronous Limit: 6 MB - Asynchronous Limit: 12 MB
and Email services heap size is 36 MB.