Heap snapshot on OOM due to buffers/external memory/large arrays rather than V8 heap
Nessuno ha ancora preso questa issue.
- Lingua principale
- JavaScript
- Stelle
- 122k
- Fork
- 37.4k
- Merge medio
- 4g 3h
- PR unite (30g)
- 272
Descrizione
What is the problem this feature will solve?
I have a server that's been OOMing when it hits the Docker memory limit I set of 2GB. I had set --max-old-space-size=432 --max-semi-space-size=16 --heap-snapshot-on-oom but Node isn't logging OOM or creating a heap snapshot so I think the issue is too much buffer allocation.
It sure sucks that there's no surefire way to get diagnostic information if too many buffers get allocated.
What is the feature you are proposing to solve the problem?
I'm not 100% sure if this is possible but a --max-memory or --max-rss flag that would set a limit on the resident set size would be really great. If V8 heap, buffer, or C++ external object allocation would push the resident set size over this limit, Node would make a heap snapshot if --heap-snapshot-on-oom is set, and then exit.
What alternatives have you considered?
I will have to try polling process.memoryUsage() and taking my own heap dump if the memory is getting too large, but I think sudden buffer allocation is OOMing after only a few seconds so I'm not sure it will even work.
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
L’issue non indica file sorgente né test. Inizia esaminando la gestione di --heap-snapshot-on-oom e process.memoryUsage() in Node, quindi determina come sono rappresentati i limiti dell’heap V8, di Buffer, della memoria esterna e di RSS; per considerare il lavoro completato servirebbero un design definito, un’implementazione e una copertura dei test per il comportamento proposto di --max-memory o --max-rss.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- javascript, node.js
- Ambito
- backend, operating-systems
- Tipo di issue
- Funzionalità
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Tranquilla
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 35/100