brfv5-browser
brfv5-browser copied to clipboard
Firefox memory leak in webworker example
When running the minimal__webworker__track_one_face.html
example in Firefox, the webworker process gradually consumes more and more memory in the background. Eventually, the tracking becomes incredibly slow as too many resources have been consumed.
Here's a snapshot of my Mac's activity monitor after running the example for a few minutes, showing 2.38 GB memory consumption:
The other single-threaded examples tend to maintain ~300 MB memory usage. I also don't experience this issue in Chrome. I'm thinking this may be a bug in Firefox itself, but I'm posting here in case there is a simple implementation fix.
I've opened an associated Firefox bug report here. One additional piece of info is that the webworker will start releasing memory back to reasonable levels if you switch tabs. I'm wondering if there is something in the brfv5 example that is handling the blur/focus events to contribute to this.