In Winter 2018 release salesforce has released a new beta lightning component for uploading file through the lightning:fileUpload (Beta).
The documentation in this link says we can upload a file of size 2 GB:
File Upload Limits
By default, you can upload up to 10 files simultaneously unless your Salesforce admin has changed that limit. The org limit for the number of files simultaneously uploaded is a maximum of 25 files and a minimum of 3 files. The maximum file size you can upload is 2 GB. In Communities, the file size limits and types allowed follow the settings determined by community file moderation.
Apex heap size limit for synchronous transactions is 6 MB and async is 12 MB. If heap size is 6 OR 12 MB how can someone upload a file of size 2 GB?
When the file is transferred to server is it even considered part of Heap size?
Any documentation on how heap size is calculated will be really helpful.