0

I have a nodejs application which receives and processes the REST API calls.

And I found out that its memory usage continually grow and never drop down.

Is that because my application creates obj and never recycle it in a loop?

Is there any VALGRIND equivalent tool for nodejs application?

How can I detect the memory leak on nodejs app?

Renato Gama
  • 16,431
  • 12
  • 58
  • 92
mzzhmh
  • 79
  • 9
  • Since you've provided no code for us to look at, the only think anyone could do is to give you the same advice you'd find if you do a bunch of searching related to memory leaks in node.js and then ask more specific questions about what you find doing that. There are hundreds of articles on this topic you can find with search. – jfriend00 Apr 09 '18 at 01:58
  • Some other references on memory leaks: [Memory doesn't decrease - what's going on](https://stackoverflow.com/questions/29885939/memory-usage-doesnt-decrease-in-node-js-whats-going-on/29885992#29885992), [Heap snapshots](https://www.google.com/search?q=node%20js%20heap%20snapshot), [Debugging memory leak](https://github.com/felixge/node-memory-leak-tutorial). – jfriend00 Apr 09 '18 at 02:19

1 Answers1

0

One way to detect a memory leak would be to use Node's --inspect flag. You could also use memwatch and headdump modules for a more detailed analysis. This link is a great resource to start of. This one has a more in-depth explanation on what is actually happening under the hood.

Sashi
  • 2,659
  • 5
  • 26
  • 38