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
Andrew DIAndrew DI 

Maximum view state size limit (135KB) exceeded for Develop->Apex Classes->Compile all classes

Hi people,

 

Today I faced with interesting problem. When I try to Compile all classes I have a 'nice' error 'Maximum view state size limit (135KB) exceeded.'.

 

Did someone have this kind of problem? If so, how to solve this issue?

 

Thanks in advance.

Best Answer chosen by Admin (Salesforce Developers) 
sfdcfoxsfdcfox
I'm pretty sure that some PM has it on their table of things to fix. I myself posted about that a few months back when I had a similar problem, and I found that to be the cause.

All Answers

Andrew DIAndrew DI

Please check this screenshot and this one.

Sorry for being not very clear.

anup-prakashanup-prakash
show your class and controller.. try nullify the data if not being used..
and iff using attachments then remove the body after the usage
Andrew DIAndrew DI
Have you seen screenshots?
Kiran  KurellaKiran Kurella
It looks like a SF issue. If the problem still exists then you should raise a ticket with SF to resolve the issue. Please post the outcome of the ticket so that the community can benefit from the post.
Andrew DIAndrew DI
Where to post?
Kiran  KurellaKiran Kurella
Click on "Help" link on the top right most of the page (next to your name or login name). On the Help page, click on "Manage Cases" and open a new Case and post your issue.
anup-prakashanup-prakash
click your name, then >> setup >> personal information >> personal Information>>> enable view state in development mode.. your code is not nullifying the data... after the operation..
sfdcfoxsfdcfox

This can happen when you have a large number of classes in your organization AND there are a signficant number of compilation errors. You have to fix the compilation errors using another tool, such as the Force.com IDE, or correct your compilation errors and try again.

 

This often happens in code bases that use utility classes, where one or more functions are altered such that they no longer match the signature of the classes that depend on them. You might want to make an "invalid class" list view, try editing each class that is invalid (just edit->save, if there's a problem, fix it and go to the next class).

 

The Apex Classes page is a Visualforce page, runs on the Visualforce engine, and is subject to the same limitations as normal Visualforce. Having too many compilation errors results in this message.

Andrew DIAndrew DI
Yes. You are 100%.
After I fixed all errors the problem gone. But still, there should be some check or some treatment of such kind of situations.
sfdcfoxsfdcfox
I'm pretty sure that some PM has it on their table of things to fix. I myself posted about that a few months back when I had a similar problem, and I found that to be the cause.
This was selected as the best answer
Andrew DIAndrew DI
Thanks for heads up!
Sai Ram ASai Ram A

I got the Same error in my Org, Can you please elobarate how to resolve this?

 

Thanks in advance!!

anup-prakashanup-prakash
if you can show your code here.. would be nice.. and we could help.. else try to nullify or try using the transient keyword.. should help..
Sai Ram ASai Ram A

I have n number of Classes in my Org, How to Identify which class has got the Issue. I understand that we have to Edit all Utility class and Save then we can find a Compile error...

 

Then we need to fix it , and you wont get this issue any more?

 

Is this how i should do?

 

Thnaks for Quick reply, i appreciate that 

Andrew DIAndrew DI

Just try to reduce number of error using Force.com IDE or just fixing them through web site.

We have this problem because of enormous number of errors in your org. Just fix errors.

Andrew DIAndrew DI
Go to your Force.com IDE. Open a class you suspect that may have an error. Edit (just add space and remove it) it and save. After you save it it will return you an error. If no error GOTO next class :-) There is no other way to do this.
Actually, you may try to deploy change set somewhere and validate you CS. Maybe it will give you some info. But I don't know. It just poped up in my mind.
anup-prakashanup-prakash
it should be associated to the class through which the page is associated. the page that is throwing the 135kb error..
Andrew DIAndrew DI
Man, we are talking about STANDARD VF page of Salesforce.com. Salesforce.com built it. We can't do anything with it's code. At all.
anup-prakashanup-prakash
are you using the Standard controller or custom controller to retrieve data?
Rashmi TyagiRashmi Tyagi
Thanks @sfdcox, it helped resolving the issue.