2

My nodejs application is leaking memory, so I was trying to use heapdump to compare the memory changes, unfortunately, memory does not change in headdump, but my nodejs process is leaking memory.So I was thinking native-modules could be one culprit, then I was using mtrace to figure it out. But I could not understand Module "/lib64/libstdc++.so.6" is increasing the size.

Does anyone could help give me some suggestions of tools or ways to figure out memory leak that does not happens in heap itself.

Many appreciate.

Wonderful
  • 21
  • 2

1 Answers1

2

I would advice to start your node.js application with a restricted amount of heap memory (--max_old_space_size=100 for example) and wait for an out of memory to happen.

If it happens, install node-oom-heapdump and start the process again. When it goes out of memory now, a heapdump is automatically generated, showing you the culprit. It it doesn't happen, there is no memory leak.

The reason your heapdump is not showing a rise is probably because of the garbage collector; before a heapdump is made, the garbage collector kicks in. So i'm not sure you actually have a leak; if a garbage collect fixes the heap usage, there is no leaking.

PaulR
  • 306
  • 1
  • 7