I have requirements to implement the LWC file upload wizard which should handle very large size csv file( about 1 GB).. is it doable to parse such large size csv through APEX batch method?

I tried it after googling some help and it seems like, it reach to heap size limit. is there any work around for this problem?

Appreciate if someone can guide with sample code snippets or sample.

NOTE: Tried with but no luck https://developer.financialforce.com/customizations/importing-large-csv-files-via-batch-apex/

Thanks in advance !

1 Answer 1


No, Apex won't handle 1GB. A single string can be at most heap size in length (12MB for Batch Apex). Since you're using LWC, process the file client-side and pass the data in chunks to Apex. If you anticipate files of this size, you will want to read the file in chunks using File.slice as demonstrated in this Stack Overflow answer.

  • Thanks for valuable comments. Commented Jun 8, 2020 at 13:38

You must log in to answer this question.

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