You need to sign in to do that
Don't have an account?
Platy IT
Reducing the size of the Internal node of the View State
I'm hitting "Maximum view state size limit (135KB) exceeded" errors when certain actions are performed on my page. When I look at the View State, about 95% of the content comes from Internal. I have tried adding "transient" to the few variables that could potentially get large, though right now I'm only dealing with data from 63 records in just a few fields (no blobs or long text fields even). Any tips on what I can do to reduce that View State, or track down what's causing it?
HI Jessie,
You said you have already tried using the transient keyword. View state is nothing but a persistent state that a VF page tries to maintain and make it available when the page is reloaded or redirected. It saves all the values in the form tag those are not transient.
Are you querying a big number of fields for these 63 records and getting them all on the page. Can you reduce the number of fields here.
You should check again if you have any variables in the class that you do not want when the page is reloaaded or redirected and you can make them all transient. Also make the apex form as smaller as possible so that you dont have components in the form tag, those can be avoided.
All Answers
HI Jessie,
You said you have already tried using the transient keyword. View state is nothing but a persistent state that a VF page tries to maintain and make it available when the page is reloaded or redirected. It saves all the values in the form tag those are not transient.
Are you querying a big number of fields for these 63 records and getting them all on the page. Can you reduce the number of fields here.
You should check again if you have any variables in the class that you do not want when the page is reloaaded or redirected and you can make them all transient. Also make the apex form as smaller as possible so that you dont have components in the form tag, those can be avoided.
Thanks Gulshan. Ultimately it ended up being one custom component that wasn't even being loaded when I was getting the error, and strangely when I copied the content of that component directly into the page, no more view state error. Forced me to make my page a lot more efficient so it was a good learning exercise if nothing else :)