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

How to find view state size for Visualforce page?

Can I find out view state size of my Visualforce page in advance and show customized error message to user instead of showing something like 


"Maximum view state size limit (135KB) exceeded. Actual view state size for this page was 138.141KB"


How can it be done? Please suggest.





Easiest way is to enable Developer mode in your profile and tick the box that says to show view state.  you'll get a tab in the developer strip at the bottom of the VF page


Hi Ministe,


Thanks for the response. I am already doing that. I was referring to do that in Code on runtime.