bezzad / Downloader

Fast, cross-platform and reliable multipart downloader with asynchronous progress events for .NET applications.
MIT License
1.25k stars 193 forks source link

High memory usage while downloading large files #134

Closed ShihabSoft closed 1 year ago

ShihabSoft commented 1 year ago

Hi there,

I've tried the OnTheFlyDownload = true option, but this definition is not in the DownloadConfiguration class anymore.

I am seeing very high memory usage while downloading a humungous file. I've searched through all the issues but I don't find any other alternatives for this setting.

ShihabSoft commented 1 year ago

Update:

Found out that, when I enable ParallelDownload = true, memory usage shoots up and it consumes all the system RAM, disabling it fixes it.

bezzad commented 1 year ago

I released a new version (v3.0.5) to control memory buffering capacity. If you want to limit memory usage with the Downloader add the below config to your DownloadConfiguration:

 MaximumMemoryBufferBytes = 1024 * 1024 * 50,  // release memory buffer after each 50 MB