Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Memory leak / lack of GC on Android Chrome when using workerize-loader

Aperta
#116 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
20/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
android, javascript, react, webpack

Direzione di ricerca

Inizia riproducendo la crescita della memoria con il CodeSandbox collegato su Android Chrome, quindi esamina /src/components/qreader-zxing.js e /src/workers/zxing.worker.js. Usa gli snapshot della memoria di Android Chrome DevTools riportati e le osservazioni di chrome://tracing per determinare se il comportamento è causato dall’esempio, dalla comunicazione con il worker o dal browser; il lavoro è completato solo quando la causa è confermata ed è disponibile una correzione chiaramente attuabile o un report upstream.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
JavaScript
Stelle
2.3k
Fork
85
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di developit/workerize-loader

Tutte le issue di developit/workerize-loader

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.