News for hackers. Stuff that matters.

Ask HN: Node.js memory optimization

Never noticed this before but I recently stated running multiple node processes on my server and each process is eating up bunch of memory. 100+ mb. Is this because node processes do not share resources? What is the best way to combat this? Is the only option to combine all processes into one?

Another question is in regards to modules and memory. If your single node process loads a module that is also loaded inside another module, is the module loaded multiple times? Or is it shared inside a single process?

( 1 comment | 5 points | on HN )
Re:Ask HN: Node.js memory optimization by gothy on Sunday November 02, 2014 @05:00AM (#8546194)
Node processes do not share resources. Exception is some shared libraries that they might use like any other process on the system.

Yes, modules are loaded and used independently in V8. Node just wraps it around and adds some additional features.