We have a batchable Apex where we read two CSV attachments on a custom object and we perform various operations on Accounts and Addresses that the CSV contain. The problem is when the files are a bit large (1,61 MB and 872 KB so total approximately 2MB) we get error related to Heap Size Exceeded. The problem is that the only thing that is being performed synchronously is the reading of content. All the other processes are being performed asynchronously.
I have not understood this error and how i could overcome it. Any ideas?