walmen
walmen

Reputation: 161

Node.js memory usage never decrease

I've already finished my first small project in node.js and now came time for performance testing using apache benchmark (1000 requests with 50 concurrency). Everything seems to be ok, hundred of requests handled per second, super fast, no failed request, just perfect. Unfortunately there is one really wired issue...the memory usage of a process keeps increasing, so lets say the memory usage is 10% just before apache benchmark will have finished his job and after that job is done it still remains at the same level - 10% than decreasing to some low level (this is how I expect garbage collector should work). Is that normal node behaviour or I've made some memory leaks in my app (I even test it with the no logic API endpoint but it still happens)? Thanks in advance for any tip. I can even share my whole app code base with someone interested in that problem.

Upvotes: 3

Views: 684

Answers (2)

snathan
snathan

Reputation: 535

Here's a blog that may help you to identify this with chrome dev tools and heapdump module.

http://strongloop.com/strongblog/node-js-performance-tip-of-the-week-memory-leak-diagnosis/

Upvotes: 1

adelura
adelura

Reputation: 556

I suggest to make snapshots before making requests and after using this module. After that just check which extra objects have been created and whether they are yours. Dont' forget to use Comparison mode in dev tools.

Upvotes: 1

Related Questions