Today, I executed an intensive crawler written in Node.js.
It was on a system with no much memory, and the process grown up quickly in memory.
This time, respecting best practices to avoid memory leaks was not enough.
In fact, Node.js just didn't process garbage collection as mush as I would like.
The solution: manually run the garbage collector in Node.js!
It's easy: run your program with --expose_gc
and call global.gc()
.
Thanks to James Hartig for this solution!