-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Description
The Problem
I've used Howler in production with Vue and we've seen a lot of our audio players that have been streaming for a long time use significant amounts of RAM. So I went down the rabbit hole and found out it was Howler.
I wanted to make sure the leaks are not caused by anything we have internally, so I went ahead and created a small HTML file to reproduce the behaviour of creating new Howl instances and unloading them (just the bare minimum) and it turns out the results are exactly the same.
Even if I inspect the heap manually, I can clearly see the retained size growing with each new Howl. Turns out, .unload() never really releases it.
So I actually implemented a barebones .changeSong function to replace my current howl and avoid creating new instances. MemLab is still reporting leaks BUT the retained size never changes with 10, 100 or 200 playthroughs whereas it does bubble up with my previous example (which, as far as I understand, is the recommended approach for adding more songs programatically, e.g. user adds more songs into playlist). Here's the MemLab result with .changeSong in place:
TL;DR .unload() doesn't release the instance from memory, MemLab and Chrome snapshots show a continuous increase and report memory leaks.
Reproducible Example
Reproduction Steps
- Create new Howl instance on play
- Unload previous Howl instance
- Check the results with MemLab or the Memory Tab in Chrome
Possible Solution
I assume fix .unload() so it properly releases the previous instance.
Context
/
Howler.js Version
v2.2.4
Affected Browser(s)/Versiuon(s)
Chrome 125

