node only using half of the available memory
Nessuno ha ancora preso questa issue.
- Lingua principale
- JavaScript
- Stelle
- 122k
- Fork
- 37.3k
- Merge medio
- 4g 2h
- PR unite (30g)
- 283
Descrizione
- Version: 12.19.0
- Platform: Debian Buster
- Subsystem:
What steps will reproduce the bug?
- Start a container with limited memory (something like
docker run --rm -it --memory=1G --memory-swap=1G node:12.19.0-buster-slim bash - Inspect heap size (
node -e 'const v8 = require("v8"); console.log(v8.getHeapStatistics());')
How often does it reproduce? Is there a required condition?
100%
What is the expected behavior?
node would use all available memory
What do you see instead?
node is only using half of the memory, so we either need to give the container twice as much memory as we really want it to use (which is problematic) or also specify --max-old-space-size in addition to controlling the container which means we have to keep 2 different settings in sync and that's a big pain
Additional information
It appears that it was changed here, and only using half of memory makes sense when running on a system with multiple process, but when running in a docker container, using all of the memory allocated to the container makes more sense
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
Inizia riproducendo il problema con il comando docker run fornito e il controllo node -e v8.getHeapStatistics(). Traccia il modo in cui Node.js determina il limite di memoria del container e confronta quel valore con l’allocazione 1G prevista; il lavoro è completato quando il runtime dimensiona correttamente l’heap senza richiedere un’impostazione separata di --max-old-space-size.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- docker, javascript, linux, node.js
- Ambito
- backend, devops, performance
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Tranquilla
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 52/100