← Back to Blogs Developer

Apex · Reference

Salesforce Governor Limits — the complete list

Every governor limit Salesforce enforces, grouped the way the official documentation groups them: per-transaction, platform-wide, static, size-specific, and the rest. Tables only — no fluff.

Before you rely on a number: these reflect Salesforce's documented limits as of 2025–2026. Most are hard limits that can't be raised; a few are soft and can be increased by Salesforce Support, and some are edition- or version-specific. For anything load-bearing, confirm against the current Execution Governors and Limits reference in the Apex Developer Guide.

Orientation

The six categories

Category 01

Per-Transaction Apex Limits

The headline governor limits. Counted per transaction and reset to zero for the next one. Asynchronous contexts (Batch, Future, Queueable, Scheduled) get the roomier budgets where the two columns differ.

LimitSynchronousAsynchronous
SOQL queries issued 1100200
Records retrieved by a single SOQL query50,000same
Records retrieved by Database.getQueryLocator10,000same
SOSL queries issued20same
Records retrieved by a single SOSL query2,000same
DML statements issued150same
Records processed by DML, Approval.process, or emptyRecycleBin10,000same
Stack depth for recursive trigger fire (insert/update/delete)16same
Callouts (HTTP requests or web service calls)100same
Cumulative timeout for all callouts120 ssame
@future methods per Apex invocation50same
Jobs added to the queue with System.enqueueJob501
sendEmail methods10same
Heap size6 MB12 MB
CPU time on Salesforce servers10,000 ms60,000 ms
Maximum execution time per transaction10 minsame
Push-notification method calls per transaction10same
Push notifications per method call2,000same

1 Each parent-child relationship subquery counts as an extra query; subqueries have a limit of 3× the top-level number (300). SOQL on custom metadata types doesn't count toward the limit. CPU time excludes time spent waiting on the database and callouts.

Category 02

Per-Transaction Certified Managed Package Limits

Code from a certified managed package (built by a Salesforce ISV partner that passed security review) gets its own separate allowance for most per-transaction limits — so a transaction spanning your code plus a package can exceed a single org limit.

BehaviourWhat it means
Separate poolsThe package gets its own 100 SOQL, 150 DML, etc., in addition to your org's native limits.
Shared (counted once)Heap size, CPU time, max transaction time, and a few others are shared across the whole transaction regardless of packages.
NamespacesNo limit on how many certified namespaces are invoked in one transaction.
Non-certified packagesUncertified or non-ISV package code has no separate limits — its usage counts against your org's totals.

Category 03

Lightning Platform Apex Limits

Not tied to a single transaction. The platform enforces these org-wide, frequently over a rolling 24-hour window.

LimitValue
Async Apex executions per 24 h (Batch + Future + Queueable + Scheduled)250,000 or licenses × 200
whichever is greater
Concurrent synchronous long-running transactions (> 5 s) per org10
Apex classes scheduled concurrently100
Batch Apex jobs in the flex queue (Holding status)100
Batch Apex jobs Queued or Active concurrently5
Batch Apex start method concurrent executions1
Query cursors open concurrently per user50

Category 04

Static Apex Limits

Fixed values applied across all transactions.

LimitValue
Default callout timeout (HTTP / web service)10 s
Maximum callout request or response size6 MB sync / 12 MB async
Maximum SOQL query run time before Salesforce cancels it120 s
Class & trigger code units in one Apex deployment7,500
Apex trigger batch size200
For-loop list batch size200
Records returned for a Batch Apex Database.QueryLocator50 million

Category 05

Size-Specific Apex Limits

Caps on the size of the code itself.

LimitValueType
Total Apex code across the whole org6 MBsoft
Characters in a single class1,000,000hard
Characters in a single trigger1,000,000hard
Compiled size of a single method65,535 bytecodehard

The 6 MB org-wide code limit excludes test classes and managed-package code, and can be raised by Salesforce Support.

Category 06

Miscellaneous Apex Limits

LimitValue
SOQL OFFSET clause maximum rows2,000
Aggregate / relationship subqueries per SOQL query300
Records per Database.getQueryLocator (non-batch)10,000
Items in a List / Set / Map collectionlimited only by heap

Category 06 · email & push

Email & Push Notification Limits

LimitValue
Messaging.sendEmail invocations per transaction10
Single emails to external addresses via Apex, per day5,000
Push-notification method calls per transaction10
Notifications per push-notification method call2,000

Mass-email recipient limits are edition-dependent and counted separately from the Apex single-email allocation.

Adjacent allocations

Other platform limits people lump in

These aren't Apex per-transaction governor limits, but they trip people up the same way, so they're worth listing alongside.

LimitValue
Web-to-Lead500 / day
Web-to-Case5,000 / day
Email-to-Case2,500 / day
Paused Flow interviews per org50,000
Sharing rules per object300
Role hierarchy500 default · ~10,000 max

At runtime

Read any limit with the Limits class

Every meter has a paired "used" and "ceiling" method. Log them or back off before you trip.

MeterUsed so farThe cap
SOQL queriesgetQueries()getLimitQueries()
SOQL query rowsgetQueryRows()getLimitQueryRows()
DML statementsgetDmlStatements()getLimitDmlStatements()
DML rowsgetDmlRows()getLimitDmlRows()
SOSL queriesgetSoslQueries()getLimitSoslQueries()
CPU timegetCpuTime()getLimitCpuTime()
Heap sizegetHeapSize()getLimitHeapSize()
CalloutsgetCallouts()getLimitCallouts()
@future callsgetFutureCalls()getLimitFutureCalls()
Queueable jobsgetQueueableJobs()getLimitQueueableJobs()
Email invocationsgetEmailInvocations()getLimitEmailInvocations()
Aggregate / subqueriesgetAggregateQueries()getLimitAggregateQueries()
apex
// Live usage vs ceiling for the current transaction
System.debug('SOQL: ' + Limits.getQueries() + ' / ' + Limits.getLimitQueries());
System.debug('DML:  ' + Limits.getDmlStatements() + ' / ' + Limits.getLimitDmlStatements());
System.debug('CPU:  ' + Limits.getCpuTime() + ' / ' + Limits.getLimitCpuTime());

When you trip one

The exception message → which limit

A LimitException can't be caught to keep running past the cap — the whole transaction rolls back. Here's how to read the message.

Runtime messageThe limit it hit
Too many SOQL queries: 101100 SOQL queries (sync)
Too many query rows: 5000150,000 records from SOQL
Too many DML statements: 151150 DML statements
Too many DML rows: 1000110,000 records via DML
Apex CPU time limit exceeded10 s sync / 60 s async CPU
Apex heap size too large6 MB sync / 12 MB async heap
Too many SOSL queries: 2120 SOSL queries
Too many callouts: 101100 callouts
Too many future calls: 5150 @future invocations
Maximum stack depth reached: 1716 recursive trigger levels

Salesforce Governor Limits — Complete Reference

Compiled from Salesforce's Execution Governors and Limits documentation. Values current as of 2025–2026; confirm hard numbers in the official Apex Developer Guide before relying on an edge case.

Welcome Back

OR
Don't have an account? Sign up