alexcorvi / heic2any

Converting HEIF/HEIF image formats to PNG/GIF/JPEG in the browser
https://alexcorvi.github.io/heic2any/
MIT License
585 stars 74 forks source link

Worker leaks 70 Mb of RAM #30

Open chebum opened 2 years ago

chebum commented 2 years ago

The heic2any library uses a web worker to convert HEIC files. After converting a file, the worker remain in memory until page refresh. It leaks about 70Mb on my machine.

Proposed fix: https://github.com/chebum/heic2any/commit/39327e2e86886e62f51cb676c8e206876a5732d8

It terminates web worker after 10 seconds of inactivity.

Fixed heic2any.js is available here: https://github.com/chebum/heic2any/tree/master/dist

The fix also includes pull request #27