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

grpc-js memory leak #10418

Closed
3 of 15 tasks
tringuyencitigo opened this issue Oct 19, 2022 · 7 comments
Closed
3 of 15 tasks

grpc-js memory leak #10418

tringuyencitigo opened this issue Oct 19, 2022 · 7 comments

Comments

@tringuyencitigo
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

A lot of GRPC sessions are retained and are not garbage collected after responding to clients, as shown in the image.

Screenshot from 2022-10-19 10-46-33

Something related to channelz I suppose. It looks like I'm getting the same issue as in grpc/grpc-node#2068. I have upgraded to the latest version of grpc-js and it's still not working.

Minimum reproduction code

https://gist.github.com/tringuyencitigo/64a08c5790162483d98e2f638bfaaad9

Steps to reproduce

No response

Expected behavior

Memory consumption not gradually going up.

Package

  • I don't know. Or some 3rd-party package
  • @nestjs/common
  • @nestjs/core
  • @nestjs/microservices
  • @nestjs/platform-express
  • @nestjs/platform-fastify
  • @nestjs/platform-socket.io
  • @nestjs/platform-ws
  • @nestjs/testing
  • @nestjs/websockets
  • Other (see below)

Other package

@grpc/grpc-js 1.7.1

NestJS version

@nestjs/microservices 9.1.2

Packages versions

Node.js version

14.17.0

In which operating systems have you tested?

  • macOS
  • Windows
  • Linux

Other

I'm happy to provide anything required.

@tringuyencitigo tringuyencitigo added the needs triage This issue has not been looked into label Oct 19, 2022
@kamilmysliwiec
Copy link
Member

Please provide a minimum reproduction repository (Git repository/StackBlitz/CodeSandbox project).

@kamilmysliwiec kamilmysliwiec added needs clarification and removed needs triage This issue has not been looked into labels Oct 25, 2022
@boolka
Copy link

boolka commented Oct 31, 2022

Have the same here
nghttp2-memory
nghttp2-memory2

@jmcdo29
Copy link
Member

jmcdo29 commented Oct 31, 2022

@boolka
Please provide a minimum reproduction repository (Git repository/StackBlitz/CodeSandbox project).

why reproductions are required

@chinmayacharya19
Copy link

Was there any resolution to this? it seems it was just closed without comments, Looks like user had provided code to reproduce.

We are noticing this in our staging environment, where health calls are constantly running, just starting the service and keeping it idle seems to have created a memory leak situation, the RAM is slowly piling up.

@fmonpelat
Copy link

fmonpelat commented Apr 24, 2023

I have the same issue, i have an app on k8s and when healthchecks are checked (through http with terminus and hybrid microservice), server gets memory leak so that at some point k8s is restarting the pod, we sticked with an old version previous to nestjs v8 (thats when it was switched to grpc-js).

@fmonpelat
Copy link

could this issue be reopened? @kamilmysliwiec ? now it has the code to reproduce.

@kamilmysliwiec
Copy link
Member

kamilmysliwiec commented May 17, 2023

There's still no minimum reproduction repository in this issue.

Please, create a new issue with a reproduction repository (that proves the memory leak really occurs of course).

@nestjs nestjs locked and limited conversation to collaborators May 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants