Link to your account

To help streamline our login experience, you can now access the Trailblazer Community Groups Platform with your account. Click details and how to link your accounts.

Chunking to overcome the Apex Heap Governor

About this event

The dreaded Salesforce governor! Have you ever needed to work with large files in apex, only to be harshly and suddenly shut down by the apex governor due to HEAP_LIMIT_EXCEEDED?

Consider this customer use case: Salesforce should callout to retrieve a 20MB file using service account credentials for authentication and make it available to download to the user. A client-side callout is problematic for several reasons, mainly security. A callout from apex would halt attempting to manage a file of this size.

Enter the chunking pattern! By retrieving a heap-manageable chunk of the file at a time and combining on the client side, we are able to work within the apex heap limits.

In this session we review the problem statement, review several options to overcome the apex heap, showcase the chunking pattern, show its elegance and simplicity, and finally review a customer implementation recently where this was used.



Tuesday, Feb 22
4:00 PM - 5:00 PM (MST)

Group Leaders

  • Mike Tetlow

    Mike Tetlow



  • Paul Fox

    Paul Fox



  • Jeff Pearson

    Jeff Pearson

    Snowytree LLC


  • Lauren LaMonte

    Lauren LaMonte


    Community Group Leader

Join your local Trailblazer Community Group, meet other developers & get best practices for building on the App Cloud