Pm2 shows 1.2 GB while heapdump shows 80 MB

I am writing a nodeJS application using node v0.12.7.

I am running a nodejs application using pm2 v0.14.7.

It looks like I have a memory leak in my application, as it bounces from 180 MB when I start it to about 1 GB in 24 hours.

I am trying to investigate this issue.

so far I have found the following tools:

memwatch-next heapdump node -inspector

with the node inspector, I found some processor problems and I was able to fix them easily.

with memwatch-next and heapdump I'm trying to get a full application memory card, the problem is this:

after 24 hours of my application and after pm2 they show that the memory grows to more than 1 GB, when I create a heapdump heap using any of these tools, it creates a heap of memory of about 80 MB.

my question is: where are the others?

If the application memory is about 1 GB, how can I see the memory card of my entire application to find memory leaks? What am I missing?

All information regarding this issue would be greatly appreciated.

+4
source share
1 answer

Do you use a buffer object in your code?

A Buffer is similar to an array of integers, but corresponds to the allocation of raw memory outside the V8 heap

And yet, enter the code below, showing

process.memoryUsage();
//ouput { rss: 19730432, heapTotal: 9751808, heapUsed: 4768896 }

, rss- pm2;

+4

Source: https://habr.com/ru/post/1608312/


All Articles