function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
QuickDEVQuickDEV 

What is Heap size?

Can somebody explain what does it mean by Heap size?  Or please direct me in right direction.

 

Thanks in Advance.

Best Answer chosen by Admin (Salesforce Developers) 
aalbertaalbert

It is in reference to the amount of memory used by the objects. When you create objects in Apex code, as with Java or any standard programming language, memory is allocated to store the objects. And that memory is allocated from the allocated heap.Think of it is a designated amount of memory you can use up in your Apex request. 

 

All Answers

aalbertaalbert

It is in reference to the amount of memory used by the objects. When you create objects in Apex code, as with Java or any standard programming language, memory is allocated to store the objects. And that memory is allocated from the allocated heap.Think of it is a designated amount of memory you can use up in your Apex request. 

 

This was selected as the best answer
QuickDEVQuickDEV

Thanks so much for the quick response.

 

One more quick question:  What is the heap size limit (Governor limit) with respect to SFDC?

 

Thanks

aalbertaalbert
It is no different in Apex code. The heap size is the amount of memory allocated to objects that are being defined in your Apex code. And Apex code puts in a limit to the total allowed size of the apex heap size. This governor limit is calculated at runtime and depends on how the governor is invoked. For more information on Governors, please find this new article on the topic. The details on the specific governor limits is listed here
SunidharSunidhar

for synchronous heap size is 6 MB, for asynchronous it is 12 MB

shephalishephali
Hi aalbert,

When u say 'Object' what u really mean by that...object as to create 'Table' in SF or object as any variable??

Thanks
ranbir das 1ranbir das 1
Its a reference of a class.