Apex heap size too large

edited June 25, 2020 in Questions
In one of my skuid page for new records i am getting error as: Apex heap size too large: 9436523 Please can any one tell me why i am getting this error? Please reply ASAP and tell me of this error. Thanks. Arpit


  • Zach McElrathZach McElrath Principal Software Engineer Chattanooga, TN 💎💎💎
    edited March 2, 2017
    Hello Arpit, The heap size limit is exceeded when a combination of too much data and metadata is retrieved into Skuid. Here are some possible causes of this issue, and way to resolve: 1 (most likely). You are requesting too many records in one of your Models. If you are working on a Skuid Page for creating new records, make sure that your Models have the "Load model data on page load" property (in the Model "Advanced" properties) turned OFF --- if this is turned on, and your Models do not have any Conditions, then your models will try to load a TON of data, which will kill your page. 2) You are requesting too many Fields in your Models --- usually only happens when you have multiple Models on your page with 100's of fields in each. 3) You have too many Models, and those Models all are requesting Picklist fields that have lots and lots of Picklist values. Try consolidating your Models. Regards, Zach
  • edited December 17, 2014
    Thanks Zach. It resolved my issue. Thanks.
  • edited April 11, 2017
    We've hit this once or twice and used these hints to fix the issue. But today we've hit it differently. The page itself renders fine, but the Skuid page builder for the page returns the heap size error. So we can't get at the page to fix it, which is a tad challenging. This is on v4.2.
  • Zach McElrathZach McElrath Principal Software Engineer Chattanooga, TN 💎💎💎
    edited December 21, 2016
    That's no fun. I'd try modifying your Page XML to remove a Model or some fields in a Model. You can do that by going to the URL: /apex/skuid__UI?page=PageXMLEdit&id=[YOUR_PAGE_ID]
  • edited December 1, 2014
    Thanks Zach. Amazingly, I didn't know about that URL, so that's very handy. Looks like the issue was that we had a sizeable chunk of Javascript in the page as inline resources and it seems that removing that out to static resources might take the burden off the Page Builder page. So that's easy enough to manage.
  • edited June 25, 2020
    Hi Zach, hoping you have a recommendation for me on an Account Detail page.  I have a tab for Opportunities and I am trying to display all Opportunities (open and closed) that have a Ship Date greater than last quarter.  I ran into the same Apex heap size too large error.  The Account I was testing in preview has 700 Opportunities that fit the condition I set.  I realize this is a large data set but even just open Opptys for this particular account would be close to 400.
    Is there any way we will be able to provide access to all these records through the Account Detail page?  I appreciate any guidance you have.
  • Pat VachonPat Vachon 💎💎💎
    edited January 5, 2016
    You can also reduce the number of fields you choose in the model. If you've got 300 fields in the model, then for sure you've be able to resolved the issue by reducing them down to the fields you see on the page.
  • edited January 7, 2015
    Thanks Pat!  I only had about 15 fields in the model but I took a few out and the error went away.
  • edited October 17, 2019
    i want 50,000 of row from master i am also getting the same error
  • Matt BrownMatt Brown ✭✭✭✭
    edited October 17, 2019
    Prashant, Salesforce standard SOQL queries typically hit the limit around 6000 records, give or take. Does the user need to see 50,000 rows? You may want to try an aggregate model - aggregate SOQL queries are able to process across many more rows. But even then, a lot depends on the data you're aggregating (whether fields are indexed, how many fields you're returning, etc.).
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!