Governor limit errors

Governor limits cap what one transaction can consume, and exceeding one throws a System.LimitException that cannot be caught with try/catch. The whole transaction rolls back. The fix is always to use less of the resource, not to handle the error.

A transaction includes everything that runs from one save: triggers, flows, validation, and any automation they set off. Limits are shared across all of it.

LimitSynchronousAsynchronousError message
SOQL queries100200Too many SOQL queries: 101
Records retrieved by SOQL50,00050,000Too many query rows: 50001
DML statements150150Too many DML statements: 151
Records processed by DML10,00010,000Too many DML rows: 10001
CPU time10,000 ms60,000 msApex CPU time limit exceeded
Heap size10 MB25 MBApex heap size too large
Callouts100100Too many callouts: 101
Future calls500 in batch and future, 50 in queueableToo many future calls: 51
Trigger recursion depth1616Maximum trigger depth exceeded

Source: Execution Governors and Limits, Winter ’27. Certified managed packages get their own allowance for most of these limits. CPU time and heap size are shared across the whole transaction.

You may also like...