Memory leak / lack of GC on Android Chrome when using workerize-loader
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 20/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- android, javascript, react, webpack
- Domain
- mobile-dev, performance, web-dev
Research direction
Start by reproducing the memory growth with the linked CodeSandbox on Android Chrome, then inspect /src/components/qreader-zxing.js and /src/workers/zxing.worker.js. Use the reported Android Chrome DevTools memory snapshots and chrome://tracing observations to determine whether the behavior is caused by the sample, worker communication, or the browser; done requires a confirmed cause and a clearly actionable fix or upstream report.
Written by the indexing model from the issue text.
Description
Hi,
First of all - thank you for a fantastic library to make web workers usable for more complex things :)
Not sure this is the right place to ask, but would appreciate some advice if anyone have seen similar problems before.
I have a project setup where I am pushing 35 MB/sec (10fps 1280x720) from a webcam feed to a worker set up by workerize-loader to search for QR codes in the image data (using HTML5 canvas).
This seems to work fine most of the time - the worker heap grows quickly according to memory snapshots in Chrome DevTools but is garbage collected frequently enough for Chrome to handle. The exception here is Android Chrome.
Memory snapshots on Android / Chrome Devtools show worker heap is frequently GC'ed (varies from 1.3MB to >100MB and back to 1.3MB) but then "suddenly" is not anymore (>500MB heap) and Chrome crashes.
Looking at chrome://tracing with an Android phone connected shows available memory dropping continuously until things crash - the memory freed from the worker heap during GC is not shown as available in chrome://tracing.
Is there anything with the promise/event mechanism between the main thread and the worker that could make things not being garbage collected? Or could this be simply a Chrome bug on Android? Do I have a bug on my side? ¯_(ツ)_/¯
Sample project (Gatsby and React for now, soon Preact):
https://codesandbox.io/s/1di20
Relevant files are /src/components/qreader-zxing.js and /src/workers/zxing.worker.js
- Dominant language
- JavaScript
- Stars
- 2.3k
- Forks
- 85
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from developit/workerize-loader
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
developit/workerize-loader#131 · 6 comments · 1 reaction ·
-
Difficulty 4/5 3-5 days Newbie friendliness 38/100
developit/workerize-loader#130 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 52/100
developit/workerize-loader#129 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
developit/workerize-loader#128 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
developit/workerize-loader#126 · 4 comments ·
All issues in developit/workerize-loader
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
mksglu/context-mode#1200 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
neondatabase/website#5944 ·
-
module: core
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
bigbluebutton/bigbluebutton#25849 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
jaegertracing/jaeger-ui#4506 ·