function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Ralph CallawayRalph Callaway 

Why is my visualforce view state so big? WTF-Platform Bug?*$@!$#@$

I have a relatively simple visualforce page following all the listed best practices (avoided multiple component controllers, use transient, don't use multiple forms, etc.) for managing view state, but I'm continually getting view state limit exceeded errors.  Trouble is, my controller and my variables only account for a paltry 15KB out of the 135KB limit with the mysterious "Internal" section taking over 90KB.  

 

WTF*&$!!@#  How is one supposed to go about optimizing a page when we don't have any idea what is in there!  Please help.

 

For full details, please see my post on Salesforce Stackexchange for a full discussion ...

 

Product Management!  R&D! Tier 3! Please HELP!!  This is no beginner question, can someone in the know please help!  I'm offering a healthy bounty for your trouble!!!

 

Could this be a platform bug????????????

Best Answer chosen by Admin (Salesforce Developers) 
Ralph CallawayRalph Callaway

Wow!! What a journey.  Turns out that apex:repeat, apex:outputpanel, and apex:input*** tags are the culprit and have a massive affect on the internal view state when multiplied over 100s of records.  Makes a lot of sense once you know how it works ...

 

For anyone interested in learning more about the mysterious "Internal" view state, click on over to the Salesforce StatckExchange post and read Andrew Fawcett's amazingly well researched answer.  Better yet, sign up for Salesforce StackExchange and start posting your questions there!!

All Answers

Starz26Starz26

You may need to rework you page to use a standardsetcontroller using a querylocator that will allow you to pagenate your results. That will greatly reduct the view state I believe.

 

I am guessing your issue is the size of the records returned. Without code sample (as has been suggested in your stack exchange replies) not much else can be done to help but additional "guesswork"

Ralph CallawayRalph Callaway

Dood, take a look back at the question, lots of code samples and images were there. 

Ralph CallawayRalph Callaway

Wow!! What a journey.  Turns out that apex:repeat, apex:outputpanel, and apex:input*** tags are the culprit and have a massive affect on the internal view state when multiplied over 100s of records.  Makes a lot of sense once you know how it works ...

 

For anyone interested in learning more about the mysterious "Internal" view state, click on over to the Salesforce StatckExchange post and read Andrew Fawcett's amazingly well researched answer.  Better yet, sign up for Salesforce StackExchange and start posting your questions there!!

This was selected as the best answer