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.
4) (http://

I hope it will be helpful.

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

Rahul Kumar