hyphmongo / batchcamp

Chrome extension to bulk download all your Bandcamp purchases
84 stars 2 forks source link

Memory leaks #7

Closed jorins closed 11 months ago

jorins commented 11 months ago

I'm using the extension with Firefox on Linux and I'm trying to download my collection in FLAC. I find myself running out of memory after about ten albums though. Closing the extension tab frees the memory. Pressing Remove completed does not. Guessing that the downloads are kept in memory even after being saved to disk.

Thank you for your excellent work :)

hyphmongo commented 11 months ago

Thanks for the report!

With Firefox the extension has to first fetch the given URL in the background, grab the filename from the content-disposition header, and then pass a blob url of the content along with the filename to the download manager.

This blob isn't automatically cleaned up by GC when the download is complete (https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL_static#memory_management)

Have just published a new version 1.0.8 which will free up this memory on complete/cancelled downloads. You should be able to verify by going to about:memory, click measure, and then search for blob-url

jorins commented 11 months ago

That solves it! Thank you for a very swift response :heart: