Memory Leak on streaming #1580
-
Trying to build a semi-permanent streaming platform using Howler, but I'm getting a steady memory leak that is consuming about a Gb of memory / hour, meaning the server runs out of memory with a system crash every 4-5 hours... which is a lot less permanent than I'd like The playlist is generated on the fly by an internal API which returns next track audio file URIs (hosted on S3), artist/song info, and the cue points. The streaming code loads the howl into an object, either Either js/howler isn't clearing the howl out of memory 'cause I haven't understood things properly, or web-audio isn't freeing memory (in which case I'm not sure what to do...). There's a simplified version of the code here: https://pastebin.com/tQifBFgC FTR: am running this on a headless browser on AWS EC2 (Ubuntu 20.04). Getting the same memory consumption with both Chrome and Firefox. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Things I've tried to date:
The memory issue is definitely in the browser, rather than some other part of the chain Finally, here's a pretty graph to make this post look more interesting [note that there's some garbage collection after the fifth track, but then all my hopes slowly crumble away...] |
Beta Was this translation helpful? Give feedback.
-
Fixed. Had switched html5 off to avoid autoplay issues, but that meant Web Audio and garbage collection issues. Problem resolved by switching html5 to true and dealing with the audio auto-starting by controling the browser with Puppeteer. No more memory problems. |
Beta Was this translation helpful? Give feedback.
Fixed.
Had switched html5 off to avoid autoplay issues, but that meant Web Audio and garbage collection issues. Problem resolved by switching html5 to true and dealing with the audio auto-starting by controling the browser with Puppeteer. No more memory problems.