Salesforcce Future Methods with Higher Limits (Pilot)

Apex future methods (methods that are annotated with @future) currently have the higher asynchronous limits for heap size, CPU timeout, and number of SOQL queries. This pilot enables you to specify even higher values for these limits and for additional limits in future methods. If you’re exceeding a governor limit in your future method, or if you think a future method requires a higher limit, you can increase this limit for your future method. This pilot also allows you to invoke a future method from another future method.

One of the following limits can be doubled or tripled for each future method.

  • Heap size
  • CPU timeout
  • Number of SOQL queries
  • Number of DML statements issued
  • Number of records that were processed as a result of DML operations, Approval.process, or Database.emptyRecycleBin

@future(limits='2x|3x***limitName***')

@future(limits='2xHeap')
public static void myFutureMethod() {
// Your code here
}

@future(limits=’2xHeap’) = Heap size limit is doubled (24 MB).

@future(limits=’3xHeap’) = Heap size limit is tripled (36 MB).

@future(limits=’2xCPU’) = CPU timeout is doubled (120,000 milliseconds).

@future(limits=’3xCPU’) = CPU timeout is tripled (180,000 milliseconds).

@future(limits=’2xSOQL’) = Number of SOQL queries limit is doubled (400).

@future(limits=’3xSOQL’) = Number of SOQL queries limit is tripled (600).

@future(limits=’2xDML’) = Number of DML statements limit is doubled (300).

@future(limits=’3xDML’) = Number of DML statements limit is tripled (450).

@future(limits=’2xDMLRows’) = Number of records that were processed as a result of DML operations is doubled (20,000).

@future(limits=’3xDMLRows’) = Number of records that were processed as a result of DML operations is tripled (30,000).


Comments

Leave a comment