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
rishi jaykar 1rishi jaykar 1 

which are under view state

  public contact con{get;set;}
    private contact conttt;
    global contact cont;
    public contact contt;
Rahul KumarRahul Kumar (Salesforce Developers) 
Hi Rishi,

Please check below post What is ViewState
Best Practices for Optimizing View State
1) Minimize Number of Forms on a Page
2) Declare Variables as Transient to Reduce View State
3) Recreate State versus Storing It in View State
4) Use Custom Objects or Custom Settings to Store Large Quantities of Read-Only Data
5) Refine Your SOQL to Retrieve Only the Data Needed by the Page
6) Refactor Your Pages to Make Its View Stateless

View State Size
The view state size of your Visualforce pages must be under 135 KB. By reducing your view state size, your pages can load quicker and still less often.You can monitor view state performance through the View State tab in the development mode footer and take the following actions:

1) Use the transient keyword in your Apex controllers for variables that aren’t essential for maintaining state and aren’t necessary during page refreshes.
2) If you notice that a large percentage of your view state comes from objects used in controllers or controller extensions, consider refining your
3) SOQL calls to return only data that's relevant to the Visualforce page.
If your view state is affected by a large component tree, try reducing the number of components your page depends on.
1) http://www.jitendrazaa.com/blog/salesforce/introduction-to-view-state-in-visualforce/
2) http://www.infallibletechie.com/2012/09/view-state-in-salesforce.html
3) http://www.infallibletechie.com/2012/09/how-to-enable-view-state-in-salesforce.html
4)http://sfdcfaq.blogspot.com/2013/04/what-is-visualforce-view-state.html (http:// http://sfdcfaq.blogspot.com/2013/04/what-is-visualforce-view-state.html)

I hope it will be helpful.

Please mark it as best answer if the information is informative.so that question is removed from an unanswered question and appear as a proper solution.

Thanks
Rahul Kumar