Has anyone run into this? JSON string exceeds heap size limit An unexpected error has occurred. Your solution provider has been notified.

  • 4
  • Question
  • Updated 3 years ago
  • Answered
The page works for some users but not for others.  They get this error showing up (sometimes and other times it works).  It's a Tab override page focused on opportunities and products.

Very confused on how to fix.  
#non-coder
Photo of Joe Ort

Joe Ort

  • 2,256 Points 2k badge 2x thumb

Posted 4 years ago

  • 4
Photo of Greg Jarrett

Greg Jarrett

  • 3,496 Points 3k badge 2x thumb
Hi Joe, I've had similar errors when the page is trying to pull in too many records (ie thousands) from the server. Are you able to limit the number of rows/records in the model using its Advanced properties?



this might depend on how many records your users need to work with, but they can always use the 'load more' button to bring in more records if required.
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Joe - you should probably read this post: https://community.skuidify.com/skuid/topics/models_how_many_is_too_many

It has some good information about the "Heap Size" error and how to avoid it. 
Photo of Gary Bailey

Gary Bailey

  • 1,628 Points 1k badge 2x thumb
We ran into the same issue on this today.  What confused me was that we were only getting the error on some of the records for the same custom object.  

Our primary model was for a custom object "Property Listing".  The page loaded that model as well as a few others (attachments, photos and activities).  

HOW WE FIXED IT:

Apparently the "Attachment" model was the culprit.  We had it set to load 20 records when the page loaded and when I reduced it down to 1 the error went away.  I haven't messed with it to see at what amount of records the error will show up again as we only need to load a single attachment record.  
(Edited)
Photo of Joe Ort

Joe Ort

  • 2,256 Points 2k badge 2x thumb
What I learned from the team was that the Body field, when pulled through, is the coding of the attachment.  Leave that off when pulling through attachments and it works.
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Yup.  Never bring in the body of an attachment.  Its no good in Skuid and it can contain a TON of data. 
Photo of JP Gazo

JP Gazo

  • 154 Points 100 badge 2x thumb
i've followed the advice from above and on the 'Attachment' model have set Max # of records (Limit)  1 record  - yet im still getting the JSON string exceeds heap size limit Error message - effectively locking up the record. 

To give some context, my client is a financial institution that need to upload a lot of documents, some bigger than some. could be 10Mb-20mb in size. 
Any advice on what else i can do to stop that message from coming up? 
Photo of Joe Ort

Joe Ort

  • 2,256 Points 2k badge 2x thumb
What fields are you pulling through with that model?  Make sure you do not include the "Body" field.