Skip to main content
Development

Governor Limits

Governor Limits are runtime caps enforced by the Salesforce platform to ensure no single tenant monopolizes shared resources in the multi-tenant architecture.

Term Context

Category

Development

10 terms in this category

Related Terms

4

connected concepts

Glossary

66

total definitions

Governor Limits Explained

Because Salesforce runs on shared infrastructure where thousands of orgs coexist on the same servers, governor limits prevent any single transaction from consuming excessive CPU, memory, or database resources. Key limits include 100 SOQL queries per synchronous transaction (200 asynchronous), 150 DML statements per transaction, 10-second CPU time limit, 6 MB heap size, and 100 callouts per transaction. Exceeding any limit throws a System.LimitException that cannot be caught.

Understanding governor limits is fundamental to writing efficient Apex. Common patterns for staying within limits include bulkifying code (processing collections rather than single records), using Maps for O(1) lookups instead of nested loops with queries, leveraging SOQL aggregates to reduce query counts, and offloading heavy processing to asynchronous methods like Batch Apex, Queueable, or @future. The Limits class provides runtime methods (e.g., Limits.getQueries(), Limits.getDmlStatements()) to monitor consumption mid-transaction. Clientell AI generates governor-limit-safe code by default and can audit existing Apex for limit-risk patterns.

Getting Started

Ready to transform your Salesforce?

Join hundreds of teams using Clientell AI to automate workflows and boost productivity.

Unlimited messages  ·  No credit card required

SOC 2
HIPAA
GDPR
Salesforce Partner