Skip to main content

Developer Limits

Explore practical guides and implementation patterns for this topic.

Posts

Topic Apex
Apex Development

Mastering Visualforce View State in Salesforce: Limits & Optimization

In plain words: View State in Salesforce is a hidden, encrypted data package passed back and forth between your browser and Salesforce servers. It remembers your Visualforce page's state (like form inputs and variables) across page refreshes or button clicks. Salesforce enforces a strict maximum limit of 170 KB for this data. If you exceed it, your page will crash with a fatal runtime error. When you build custom Visualforce apps with interactive forms, search filters, or data tables, maintaining information across server requests is crucial. Because standard web traffic doesn't naturally "remember" things, Salesforce uses View State to track your Apex controller variables and component details. If you aren't careful with how much data you store, your page weight will bloat rapidly, leading to slow performance and crashed pages.
Read article