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
ScriptMonkeyScriptMonkey 

Maximum view state size limit (135KB) exceeded... help please?

When I load a certain visualforce page, I get "Maximum view state size limit (135KB) exceeded" and I'm not sure the steps to troubleshoot, I'm not even entirely sure of the cause.

 

I found in other forums the idea that I need to use "Transient" keywords in more variables, but I'm hoping for a way I can test to see what's using up the memory rather than just guessing, then refreshing, then guessing again.

 

I've never seen this error before, and I've not used transient before, so I'm not sure the effect it will have on the page I'm supporting.  Any pointers/support would be greatly appreciated.

 

 

bob_buzzardbob_buzzard

If you edit your profile, there are two checkboxes - "development mode" and "show view state in development mode".  If you check both of these, you will have access to the view state inspector.  However, if you are already exceeding the view state it may not be much help - you might need to reduce it before you can see it properly if you get  my meaning.  

 

ScriptMonkeyScriptMonkey

bob_buzzard wrote:

If you edit your profile, there are two checkboxes - "development mode" and "show view state in development mode".  If you check both of these, you will have access to the view state inspector.  However, if you are already exceeding the view state it may not be much help - you might need to reduce it before you can see it properly if you get  my meaning.  

 



I checked both boxes and now I'm viewing the VF page.  I have the "editor" at the bottom, but where can I see the view state?

bob_buzzardbob_buzzard

On the editor bar, you should see the page name with a white background, then next to that the name(s) of extension/standard controllers, and finally View State.  If you click the view state it changes the editor into the view state inspector.

ScriptMonkeyScriptMonkey

I have the VF page, then the custom controller, then nothing..

 

I'm looking in the development org, does that matter? (instead of the org it's installed in as a package)

bob_buzzardbob_buzzard

Shouldn't do - the view state appears in my dev org as soon as I check the box.  

ScriptMonkeyScriptMonkey

can you think of a reason I wouldnt' see it?  the development mode made the bar appear, but the view state option didn't do anything.

bob_buzzardbob_buzzard

The only reason it wouldn't appear is if you didn't have a form in your page.  But if you don't have a form, you don't have a view state as far as I recall.

ScriptMonkeyScriptMonkey

I do have a form, but I just thought, the related custom class is actually a managed, packaged class installed on this org, so you can't view the code.  Would that prevent seeing the view state?

bob_buzzardbob_buzzard

There's nothing in the docs about it, but if you're seeing that behaviour it seems a likely culprit.

ScriptMonkeyScriptMonkey

That's be a no on that answer.  Just tried in the original org, still no "view state" option and I can view all the code under the controller.

 

I'm using Firefox, would that matter?

bob_buzzardbob_buzzard

I've just tried in firefox on my dev org and the view state is displayed.

 

Does your page currently exceed the view state max size?

ScriptMonkeyScriptMonkey

The development site doesn't exceed the view state, but reading online I think that development sites don't have the limitation.

 

Going to try the same steps on the production site with the problem in a few minutes, but if the error is happening, it might not even let me see the page enough to debug it.