amir1376 / ab-download-manager

A Download Manager that speeds up your downloads
https://abdownloadmanager.com
Apache License 2.0
648 stars 11 forks source link

Double Disk Writes #41

Closed SeriousHoax closed 2 weeks ago

SeriousHoax commented 4 weeks ago

I noticed that the amount of disk writes is always twice the amount of the actual downloaded files. For example, I downloaded this 37.75 MB file https://ftp.osuosl.org/pub/deluge/windows/deluge-2.1.1-win64-lt2.0-setup.exe When the download is started, immediately a 37.75 MB file was written in the Download folder. After that, again a total of 37.75 MB data was written on the disk. So, combining both about 75 MB data was written which is twice the size of the actual file. So, I was wondering why? eg:

image

Free Download Manager in this example, instead of creating a 37.75 MB file at first, it pre-allocates 37.75 MB on the download location and then writes data into that pre-allocated space. So, its disk write bytes is always the same as the size of the downloaded file.

I'm a bit sensitive about not writing unnecessary data on the disk (mainly SSD due to their limited TBW values, even if the value is high). It's one of the reasons I avoid IDM, XDM, Neat Download Manager and maybe a few others who writes data on a temporary location before combining them to create the file. So, they also have this issue.

FDM and JDownloader2 don't have this problem.

Can the same be achieved with AB Download Manager?

amir1376 commented 3 weeks ago

@SeriousHoax Hello Yes it can also be here! What you are saying is about creating a sparse file. but some filesystems don't support this. so I need to handle them too. I consider this.

SeriousHoax commented 3 weeks ago

@SeriousHoax Hello Yes it can also be here! What you are saying is about creating a sparse file. but some filesystems don't support this. so I need to handle them too. I consider this.

Oh, I see. In that case, maybe you can have an option in settings to switch to sparse file allocation so that users who prefer that can enable that. Let us know if you decide to do that.

amir1376 commented 2 weeks ago

@SeriousHoax Hello there, I added this and it will be available in the next version

SeriousHoax commented 2 weeks ago

@SeriousHoax Hello there, I added this and it will be available in the next version

Thank you. That was quicker than I expected. I'll check the feature out in the next version.