How to avoid Apex Heap Size issue in SKUID?

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.


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.