Error : Maximum view state size limit (135KB) exceeded. Actual view state size for this page was 410.891KB.  

 
Step 1:
This will occurs when the variable is u declared as a public .So try to declare this variables as transient. Because this transient keyword used to declare instance variable that cannot be saved.
Step 2:
Open the view state and check which variable it taking the kilobytes, see if you can set that variable to null after rendering the page.
You have to enable view state from your personal information if its already not enabled.
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.
Step 3:
Example:
You will be using a variable to hold file data like this.
VF Page:
 
In Apex class:
public blob file{get; set;}
Use transient keyword before blob data type. like below,
public transient blob file{get; set;}
The transient keyword gives persistency in the VF page..

Written by 

I am Sakthivel Madesh, a certified Salesforce Advanced Developer & Administrator working on Salesforce Technology since 2011. I am currently working in Techforce Services as Sr. Salesforce Developer. I have worked on multiple technologies Like PHP, Java, Salesforce, I am very passionate about Salesforce and to earn 15x Salesforce Certification. I love Trailhead for learning Salesforce Skill and Become a Trailhead 5x Ranger too. I Love to Learn & Share my Salesforce knowledge to Salesforce Learners/Beginner using My Blog and Salesforce Community.

Leave a Reply

Your email address will not be published. Required fields are marked *

*