Governer Limits

What is Governer Limit , Why this term even exist in Salesforce ?

As you must be aware salesforce is a could service provider hosting so many applications, having millions of partners and customer who interact with this cloud on daily basis.

So to avoid monopoly of a single individual/organisation and establishing the equality in terms of bandwitdh to access the shared resource governor limits are in place with salesforce.

Governor limits are classified on two measures 

1. Synchronous Interaction with servers.
2. Asynchronous Interaction with servers.


Types of Governer Limit

Per-Transaction Apex Limits

Category   Synchronous Asynchronous
SOQL Limits Total number of SOQL queries issued 100 200
Total number of records retrieved by SOQL queries 50000
Total number of records retrieved by Database.getQueryLocator 10000


SOSL Limits

Total number of SOSL queries issued

20
Total number of records retrieved by a single SOSL query 2000


DML
Total number of DML statements issued 150

Total number of records processed as a result of DML statements, Approval.process, or database.emptyRecycleBin

10000

Invoking New Apex through Triggers invocation from a running Apex 
Total stack depth for any Apex invocation that recursively fires triggers due to insertupdate, or delete statements 16
Callouts and Webservice
Total number of callouts (HTTP requests or web services calls) in   a transaction
100

Maximum cumulative timeout for all callouts (HTTP requests or Web services calls) in a transaction
120 seconds
Future Methods Maximum number of methods with the future annotation allowed per Apex invocation  50 0 in batch and future contexts; 1 in queueable contex

Queueble Apex

Maximum number of Apex jobs added to the queue with System.enqueueJob
50 1

Email

Total number of sendEmail methods allowed
10

Heap Size

Total heap size

6 MB

12 MB

CPU Exception Limit

Maximum CPU time on the Salesforce servers

10 second

60 seconds

APEX

Maximum execution time for each Apex transaction
10 minutes  

Push Notifications

Maximum number of push notification method calls allowed per Apex transaction

10

Maximum number of push notifications that can be sent in each push notification method call

2000


Lightning Platform Apex Limits

DescriptionLimit
The maximum number of asynchronous Apex method executions (batch Apex, future methods, Queueable Apex, and scheduled Apex) per a 24-hour period1250,000 or the number of user licenses in your org multiplied by 200, whichever is greater
Number of synchronous concurrent transactions for long-running transactions that last longer than 5 seconds for each org.210
Maximum number of Apex classes scheduled concurrently100. In Developer Edition orgs, the limit is 5.
Maximum number of batch Apex jobs in the Apex flex queue that are in Holding status100
Maximum number of batch Apex jobs queued or active concurrently35
Maximum number of batch Apex job start method concurrent executions41
Maximum number of batch jobs that can be submitted in a running test5
Maximum number of test classes that can be queued per 24-hour period (production orgs other than Developer Edition)5The greater of 500 or 10 multiplied by the number of test classes in the org
Maximum number of test classes that can be queued per 24-hour period (sandbox and Developer Edition orgs)5The greater of 500 or 20 multiplied by the number of test classes in the org
Maximum number of query cursors open concurrently per user650
Maximum number of query cursors open concurrently per user for the Batch Apex start method15
Maximum number of query cursors open concurrently per user for the Batch Apex execute and finish methods5

Static Apex Limits

DescriptionLimit
Default timeout of callouts (HTTP requests or Web services calls) in a transaction10 seconds
Maximum size of callout request or response (HTTP request or Web services call)16 MB for synchronous Apex or 12 MB for asynchronous Apex
Maximum SOQL query run time before Salesforce cancels the transaction120 seconds
Maximum number of class and trigger code units in a deployment of Apex5,000
Apex trigger batch size2200
For loop list batch size200
Maximum number of records returned for a Batch Apex query in Database.QueryLocator50 million

Size-Specific Apex Limits

DescriptionLimit
Maximum number of characters for a class1 million
Maximum number of characters for a trigger1 million
Maximum amount of code used by all Apex code in an org6 MB
Method size limit 65,535 bytecode instructions in compiled form

Push Notification Limits

Mobile application typeMaximum notifications per app per day
Provided by Salesforce (for example, Salesforce for iOS)50,000
Developed by your company for internal employee use35,000
Installed from the AppExchange5,000

Comments