i am getting Attempt to de-reference a null object in batch class but unable to trace where the error causing due to CUMULATIVE_LIMIT_USAGE_END in debug logs,

Here i am getting all the logs, so i have changed the debug level but still getting all the logs and CUMULATIVE_LIMIT_USAGE_END in debug logs

  • 3
    We are not mind readers and don't have access to your org. Lower your logging settings to nothing for everything but Apex and ERROR there. See if you get what you need.
    – Adrian Larson
    Commented Mar 6, 2018 at 15:08

1 Answer 1


Batch classes work on a large amount of data and thus they create large debug logs.

We can have only 2Mb of debug logs for each batch iteration, thus you have to modify your code to remove extra debugs or change the debug trace flags to DEBUG only to stop unwanted hug debugs logs being generated.

There are ways via which you can find the exact root cause.

  1. Calling Batch's execute method directly with the set of records which are causing the issue.
  2. Writing proper assert based test classes and checking which lines were missed to cover and what caused the issue.

Src: https://help.salesforce.com/articleView?id=code_debug_log.htm&type=5


Not the answer you're looking for? Browse other questions tagged .