Apex Governor Limits Explorer

Search every Apex limit — synchronous and asynchronous side by side — and check whether your loop will break before you deploy it.

  • SOQL queries issued

    Limits.getQueries()Each parent-child subquery counts as an extra query (limit: 3× the top-level limit). Custom metadata type queries don’t count.

    Sync100

    Async200

  • Records retrieved by SOQL queries

    Limits.getQueryRows()

    Limit50,000

  • Records retrieved by Database.getQueryLocator

    Limits.getQueryLocatorRows()

    Limit10,000

  • SOSL queries issued

    Limits.getSoslQueries()

    Limit20

  • Records retrieved by a single SOSL query

    Limit2,000

  • DML statements issued

    Limits.getDmlStatements()Includes insert, update, upsert, delete, undelete, merge, Database.* versions, convertLead, emptyRecycleBin, rollback, setSavepoint, Approval.process, System.runAs and EventBus.publish (publish after commit).

    Limit150

  • Records processed by DML, Approval.process or emptyRecycleBin

    Limits.getDmlRows()

    Limit10,000

  • Stack depth for recursive trigger firing (insert, update, delete)

    Limit16

  • Callouts (HTTP requests or web service calls)

    Limits.getCallouts()

    Limit100

  • Cumulative timeout for all callouts

    Limit120 seconds

  • @future method calls

    Limits.getFutureCalls()

    Sync50

    Async0 in batch and future; 50 in queueable

  • Jobs added to the queue with System.enqueueJob

    Limits.getQueueableJobs()

    Sync50

    Async1

  • sendEmail method calls

    Limits.getEmailInvocations()

    Limit10

  • Total heap size

    Limits.getHeapSize()Email services: 50 MB. Callout request and response sizes count toward heap.

    Sync10 MB

    Async25 MB

  • CPU time on the Salesforce servers

    Limits.getCpuTime()Time spent in the database for SOQL/DML and waiting for callouts isn’t counted.

    Sync10,000 ms

    Async60,000 ms

  • Execution time for each Apex transaction

    Limit10 minutes

  • Push notification method calls

    Limit10

  • Push notifications sent per push notification method call

    Limit2,000

  • EventBus.publish calls (platform events that publish immediately)

    Limits.getPublishImmediateDML()

    Limit150

  • Rows across all Apex cursors

    Limit50 million

  • Cursor.fetch calls

    Limit100

  • Asynchronous Apex executions per 24 hours (batch, future, queueable, scheduled)

    Check what’s left with OrgLimits.getMap() or the REST limits resource (DailyAsyncApexExecutions).

    Limit250,000 or 200 × user licenses, whichever is greater

  • Apex classes scheduled at the same time

    Limit100 (Developer Edition: 5)

  • Batch jobs in the flex queue in Holding status

    Limit100

  • Batch jobs queued or active at the same time

    Limit5

  • Batch job start methods running at the same time

    Limit1

  • Concurrent long-running (5 s+) synchronous transactions

    Limit1 per 100 licenses, minimum 10, maximum 50

  • Apex cursor instances per 24 hours

    Limit10,000

  • Batch jobs submitted in a running test

    Limit5

  • Default callout timeout

    Limit10 seconds

  • Callout request or response size

    Sync6 MB

    Async12 MB

  • SOQL query run time before the transaction is cancelled

    Limit120 seconds

  • Trigger batch size

    Platform event and Change Data Capture triggers: 2,000.

    Limit200

  • SOQL for-loop list batch size

    Limit200

  • Records returned by a Batch Apex Database.QueryLocator

    Limit50 million

  • Classes and triggers in one deployment

    Limit7,500

  • Characters in a class

    Limit1 million

  • Characters in a trigger

    Limit1 million

  • Apex code in an org

    Limit6 MB

  • Method size

    Limit65,535 bytecode instructions (compiled)

From the Apex Developer Guide (Winter ’27): Execution Governors and Limits — checked 22 October 2026. Scheduled Apex uses the synchronous limits.

Will my code hit a limit?

Describe one loop over your records — e.g. a trigger handling 200 records.

  • SOQL queries1 / 100
  • DML statements1 / 150
  • Records changed by DML200 / 10,000

    Breaks above 10,000 records.

  • Callouts0 / 100

Runs in your browser — nothing you paste is sent to us or stored.

How to use it

  1. 1

    Search a limit

    Type heap, CPU, SOQL, callout or batch — or pick a group. Synchronous and asynchronous values sit side by side.

  2. 2

    Describe your loop

    How many records, and how many queries, DML statements and callouts run inside and outside the loop.

  3. 3

    See where it breaks

    Each limit shows how much you use, the record count where it fails and how to fix it.

Questions

What are Apex governor limits?

Salesforce runs every org on shared servers, so it caps what one Apex transaction can do — how many queries, DML statements, callouts, how much memory (heap) and CPU time. Going over a limit throws a System.LimitException that can’t be caught, and the whole transaction rolls back.

What’s the difference between synchronous and asynchronous limits?

Asynchronous Apex — Batch Apex, Queueable and @future methods — gets higher limits for a few resources: 200 SOQL queries instead of 100, 25 MB heap instead of 10 MB and 60 seconds of CPU instead of 10 (Winter ’27). Most other limits are the same. Scheduled Apex runs with the synchronous limits.

Why does a query inside a loop break?

A trigger receives up to 200 records at a time. One query per record is 200 queries — over the synchronous limit of 100. Query once before the loop (WHERE Id IN :ids), keep the results in a Map, and do one DML statement on a List after the loop.

Do Batch Apex limits reset?

Yes — each execute() call of a batch job is its own transaction with fresh limits, which is why batch is the answer for large volumes. The org-wide limits still apply: 250,000 asynchronous executions per 24 hours (or 200 × user licenses, whichever is greater) and 5 batch jobs queued or active at once.

How do I check limits while my code runs?

The Limits class reports usage in the current transaction — Limits.getQueries() against Limits.getLimitQueries(), Limits.getHeapSize(), Limits.getCpuTime() and so on. For org-wide limits such as daily async executions, use OrgLimits.getMap() or the REST API limits resource.

How current are these numbers?

They come from the Apex Developer Guide for Winter ’27 (API 68.0), and the page shows the date we last checked. Salesforce does raise limits from time to time — the heap limits in this release are higher than the long-familiar 6 MB and 12 MB.

Further reading

Want to go beyond the tools?

Learn Salesforce development — live classes with people who build on Salesforce every day.

See the learning path →