Node.js memory usage never decreases

I have already finished my first small project in node.js and now is the time for performance testing using apache benchmark (1000 requests with 50 concurrency). Everything seems to be in order, hundreds of requests are processed per second, super fast, no crashing request, just fine. Unfortunately, there is one really wiring related issue ... memory usage continues to increase in the process, so it can be said that memory usage is 10% before the Apache test exits, and after that work is done, it still stays at the same level - 10% than dropping to some low level (this is how I expect the garbage collector to work). Is this normal node behavior, or I did some memory leaks in my application (I even test it with the API endpointno logic , but it still happens)? Thanks in advance for any advice. I can even share my entire application code base with someone interested in this issue.

+3


source to share


2 answers


I suggest taking snapshots before making queries and after using this module . After that, just check what additional objects have been created and if they are yours. Remember to use compare mode in dev tools.



+1


source


Here is a blog that can help you figure it out with chrome dev tools and the heapdump module.



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

+1


source







All Articles