Process Automation and Logic28% of the exam
Governor limits and asynchronous Apex
The per-transaction governor limits the exam quotes, how to read them with the Limits class, which limits rise in asynchronous Apex, and when to reach for future methods, Queueable, Batch or Scheduled Apex.
Given a scenario, understand governor limits and their implications on Apex transactions.
~7 min read · 11 practice questions ·
What the exam expects
- Quote the per-transaction limits for SOQL queries, query rows, DML statements, DML rows, heap and CPU time, and say which differ in asynchronous Apex.
- Predict whether a scenario (a data load, a trigger, a nightly job) exceeds a limit, given that limits are counted per transaction.
- Read limit consumption at run time with the Limits class.
- Fix limit errors in code: SOQL for loops for heap, maps instead of nested loops for CPU, Batch Apex for volume.
- Choose between future methods, Queueable, Batch and Scheduled Apex, and know each one's limits.
Key terms: governor limit (a per-transaction ceiling the runtime enforces), transaction (the unit limits are counted in), asynchronous Apex (code queued to run later in its own transaction), scope (the records one Batch Apex execute() receives).
Key facts
SOQL queries
- Detail
- 100 synchronous, 200 asynchronous
DML
- Detail
- 150 statements and 10,000 rows, both contexts
Heap and CPU
- Detail
- 6 MB and 10,000 ms synchronous; 12 MB and 60,000 ms asynchronous
Limit exceptions
- Detail
- Cannot be handled
Scheduled Apex limits
- Detail
- Synchronous limits apply
Limits class
- Detail
getX()returns used,getLimitX()returns the maximum
Future method parameters
- Detail
- Primitives or collections of primitives only
Queueable chaining
- Detail
- One child job per executing job
Batch scope
- Detail
- Default 200; maximum 2,000 with a QueryLocator
Batch transactions
- Detail
- Each execute() resets limits; earlier batches are not rolled back
Scheduled jobs
- Detail
- 100 at one time
Sources for this section (5)
- Execution Governors and Limitsdeveloper.salesforce.com (opens in a new tab)
- Future Methodsdeveloper.salesforce.com (opens in a new tab)
- Optimize Queueable Apextrailhead.salesforce.com (opens in a new tab)
- Use Batch Apexdeveloper.salesforce.com (opens in a new tab)
- Apex Schedulerdeveloper.salesforce.com (opens in a new tab)
- Why doesn't moving a per-record query into a helper class fix "Too many SOQL queries: 101"?
- Why can a scheduled job still hit the 100-query limit?
- Why can't a future method accept sObjects?
- Which two Limits methods tell code how many queries are left?
The questions are free to read. Answers with their sources and self-grading are included with the pack.
Keep reading with the Platform Developer pack
- Core concepts
- Exam traps
- Worked scenario
The pack includes:
- All 21 lessons of the Platform Developer guide, with reading progress
- Interactive decision walks and step-by-step sequence steppers
- Inline practice questions and one-click topic practice (11 questions for this lesson)
- An official source cited for every claim
- An AI tutor that answers from the guide
- Unlimited timed practice exams