Governor limits in Salesforce

Governor limits are runtime limits enforced by the Apex runtime engine. Since Apex runs in a shared, multitenant environment, the Apex runtime engine strictly enforces a number of limits to ensure that code does not monopolize shared resources.

Types of limits that Apex enforces are resources like

1. Memory

2. Database resources

3. The number of script statements to avoid infinite loops

4. The number of records being processed.

If code exceeds a limit, the associated governor issues a runtime exception. Because Apex runs in a multitenant environment, the Apex runtime engine strictly enforces a number of limits to ensure that runaway Apex doesn’t monopolize shared resources.

If some Apex code ever exceeds a limit, the associated governor issues a runtime exception that cannot be handled.

The Apex limits, or governors, track and enforce the statistics outlined in the following tables and sections.

1. Per-Transaction Apex Limits

2. Per-Transaction Certified Managed Package Limits

3. Force.com Platform Apex Limits

4. Static Apex Limits

5. Size-Specific Apex Limits

6. Miscellaneous Apex Limits

The good:

Governor limits prevent other organisation from writing bad code and taking up all the cloud CPU.
Coding limits, in general, are completely unique to Apex – consider it job security!
You have a friend that will teach you how to dominate these limits!

The bad:

These are hard limits on your org preventing you, for example, from doing too many SOQL queries in a trigger (max: 100 queries).
Upgrading your edition or paying Salesforce more money will not increase your limits! The only workaround is to understand how to navigate around them.

Please check below links. I hope that will help you

https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_gov_limits.htm

 

Advertisements