A
A
Andrey2016-02-11 17:42:50
Node.js
Andrey, 2016-02-11 17:42:50

Node.js cpu ram leak?

After some time, after 2-3 days, the processes of the node begin to eat more and more cpu and RAM.
I run 9 processes in the cluster with 0.3% RAM each and 3% cpu each. but after a week they are already eating 5% RAM and 10% cpu each, and it keeps growing and growing until you reboot the scripts.
I run the script with the --expose-gc flag:

forever --nouse-idle-notification --expose-gc --max-new-space-size=2048 --max-old-space-size=8192 start -l forever.log -a -e err.log index.js -p 3000 -h xxx.xxx.xxx.xx

gc(); does the kernel call? why memory does not throw off?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dark Hole, 2016-02-11
@abyrkov

This is called aging. Most likely, you are forgetting some variables.

N
Nicholas, 2016-02-12
@ACCNCC

--expose-gc
every 30s
setInterval(function() { global.gc() }, 30000 );

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question