+ Start a Discussion
suresh dupadasuresh dupada 

HeepSize limit while Serializing Data

Hi all,
            I am hitting an heep size limit while serializing my records, I need to send this records as a response, so below my serializePretty method
actually result =[select Id, name ... from object]; ----------------> it returns nearly 8000 records, so i Need to  serializ 8000 records, and send to response in rest resources..... how to over come this issue
  return JSON.serializePretty(result);
ShashankShashank (Salesforce Developers) 
You may havve to break your request into batches. This discussion has some good suggestions: http://salesforce.stackexchange.com/questions/50258/getting-heap-size-error-while-serializing-collection-of-records-in-apex