How to avoid Apex Heap Size issue in SKUID?

  • 1
  • Question
  • Updated 3 weeks ago
  • In Progress
A SKUID page that I am using currently has been throwing "Apex Heap Size too Large" repeatedly. 

I made some temporary fixes to avoid the issue: deleted a few unwanted models and fields. Also checked the "Max # of records (Limit)" for the models, and set the values as per my requirement. The "Query on Page Load" option is checked only for required models. But, the heap size is still large enough to throw the error if number of data records increase slightly.

I wished to know if there was a way to avoid the issue permanently. For instance, I have a few models which are used only in conditions of other models. As shown in the screenshot, the "BoxFieldsModel" is queried only to be used as conditions in another model(2nd screenshot). Is there any better way to perform this task, other than querying a separate model?





Currently I am trying to search for other options to avoid the heap size error. Any input for the same will be helpful.


Thanks,
Sejal.
Photo of Sejal

Sejal

  • 214 Points 100 badge 2x thumb

Posted 3 weeks ago

  • 1
Photo of Pat Vachon

Pat Vachon, Champion

  • 44,906 Points 20k badge 2x thumb
I've used models only for conditions before as well. You can set the number of records to 0 for those. If you do have other models that need to load all records no matter what, then you create a snippet to be called that checks models to see if there are additional rows. If so, get more. Rinse and repeat til no more rows.