I get data from a web Service and and I do some creating and updating of objects with that data. I am get the following error when i try to fetch data.
Exceeded max size limit of 6000000
This is where problem
HttpResponse res = h.send(req);
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It only takes a minute to sign up.Sign up to join this community
You have exceeded the maximum heap size limit. To handle this you need to reduce your response size. you are making synchronous calls in which we have 6MB Heap size limit. You can also try asynchronous calls in which we have 12MB Limit.
As per Salesforce docs.
The "Apex heap size too large" error occurs when too much data is being stored in memory during processing. The limit depends on the type of execution (E.g. synchronous vs asynchronous calls) and current value can found in limit document.
Some of best practices