Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to investigate RSS memory leak? #4141

Closed
mwilniewiec opened this issue Apr 5, 2023 · 7 comments
Closed

How to investigate RSS memory leak? #4141

mwilniewiec opened this issue Apr 5, 2023 · 7 comments
Labels

Comments

@mwilniewiec
Copy link

Details

I have a problem with one of my microservices that its RSS memory is rising and I don't know what should be a proper way of finding the real problem.
I already analyzed heapdumps and nothing can be found as I can see that heap is pretty stable.

process.memoryUsage() is currently showing:

external: 40866815,   (38.97 MB)
heapTotal: 135319552, (129.05 MB)
heapUsed: 114264216,  (108.97 MB)
rss: 1641189376,      (1565.16 MB)

It's a docker running inside of a k8s pod doing quite a lot of things.

  • it's a client of RabbitMQ (using amqplib) processing lots of messages
  • using prostgres with typeorm
  • using redis
  • making GRPC calls to other services
  • decompressing data using zlib.inflateSync
  • lots of other stuff

Heap:
image

RSS:
image

In the charts you can see that there are 2 instances of this microservice and both have exactly the same growth in RSS and exactly the same Heap.

Is there any way that I could analyse the other 1.3 GB of RSS memory which is not in the Heap ?

Node.js version

12.14.1

Example code

No response

Operating system

Alpine Linux v3.11 (in a Docker)

Scope

runtime

Module and version

Not applicable.

@preveen-stack
Copy link
Contributor

Take a look at v8-profiler, may be it can help

@preveen-stack
Copy link
Contributor

Also, pls check response to #4148

@mhdawson
Copy link
Member

Copy link

There has been no activity on this issue for 11 months. The help repository works best when sustained engagement moves conversation forward. The issue will be closed in 1 month. If you are still experiencing this issue on the latest supported versions of Node.js, please leave a comment.

@github-actions github-actions bot added the stale label Mar 23, 2024
@gireeshpunathil
Copy link
Member

it is worthwhile to see what is the system characteristics. summary of nodejs/node#31641 in this context is:

rss stays high for ever, if there is no demand for memory in the system

it is a known issue, and the current workaround is to ignore the observation, the growth will subside when there is a demand.

or in other words - the system will adapt to the need, don't measure too much! :)

@github-actions github-actions bot removed the stale label Mar 24, 2024
Copy link

It seems there has been no activity on this issue for a while, and it is being closed in 30 days. If you believe this issue should remain open, please leave a comment.
If you need further assistance or have questions, you can also search for similar issues on Stack Overflow.
Make sure to look at the README file for the most updated links.

@github-actions github-actions bot added the stale label Sep 20, 2024
Copy link

It seems there has been no activity on this issue for a while, and it is being closed. If you believe this issue should remain open, please leave a comment.
If you need further assistance or have questions, you can also search for similar issues on Stack Overflow.
Make sure to look at the README file for the most updated links.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants