Skip to main content

#Batchable0 人がディスカッション中

Hi, I have a batch apex that retrieves an object, that will update data in 5 different objects. I am getting heap issue. I used Limits.getHeapSize(); I cleared list after inserting(accList.clear()). In debug log with getHeapSize() shows similar size, not much difference. But in anonymous there is a change.

 

I am unable to find what is the exact heap size, where it get exceeded. Debug logs are of no use. I also tried queueable apex to insert a list and clear it later.

 

How to debug properly for this issue?

#Batchable #Batchapex #Salesforce Developer #GovernorLimits #Apex

2 件の回答
  1. 2023年10月21日 16:23

    @AMAN GARG I Created a sample batch apex with perfect optimization. But the issue is, it shows the same heap size in Limits.getHeapSize(); Probably We can say it is async, but how to exactly know where the heap gets exceeded?

0/9000

My final video in the 3 pt. series on HTTP Callouts, Batchable Apex and LWC is up on Youtube!

 

https://youtu.be/mPHIvL7Nwpw

 

This is a particularly fun episode for me as I learnt tonnes about JavaScript and LWC in the process as well as overcoming some personal doubts in my ability!

 

I hope you enjoy it, learn from it and most of all suggest way in which I can better it and/or learn more myself!!

 

As always, the likes and subs are super appreciated but if anything, please do leave a comment with feedback :)

 

@North England Community Groups @Salesforce Military @Salesforce Military & Trailhead Military @Platform Champion Alumni @* Salesforce Developers * @* Salesforce Administrators * 

0/9000

I am trying to process a large number of records.

Basically I need to derive some performance objects based on many records. 

In order to derive those performance objects I need to analyze all of the records at once. 

Is there a way to make my asynchronusly query all of the records that I need and then

once all have been gathered in, perform my operation? 

Does anyone have example code on how this can be done?  I am expecting that the answer has to do with Queueable and/or Batchable Apex but the example code does not seem to convey what I described above.

Thank you,

Justin

1 件のコメント
0/9000