-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
[node][7.113.0] tracingHandler of memory leak #11945
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
Comments
Hi @FuBaooo thanks for writing in! I took a look at your reproduction example (admittedly didn't run it). I have a feeling that the leak is happening because the Since we don't have a guide (or official support) for Nitro, I'm gonna link you to our express documentation which shows how to use the handler in express. You probably need to register the handler similarly to the Can you give this a try and report back if it fixes your mem leak? Also this issue might be related to #10790, where users also reported a memory leak. Did you use an older version of the SDK before encountering the leak? If yes, which exact version was that? We're still trying to narrow down the responsible change that caused the leaks reported in this issue. Finally, we're currently in the final stretch of releasing a new major version of the SDK which will use OpenTelemetry for instrumentation of Node frameworks. So chances are, you won't encounter this leak at all anymore once our new major is stable and you upgraded. |
@Lms24 Sorry, I do use I think it's the lack of ![]() To fix the memory leak, I executed this action in my code: ![]() |
@Lms24 I made sure I registered the Extra note: The numbers attached to the front of the file are the nitro registration order. ![]() |
@Lms24 I haven't used the old sdk, this is the latest version |
Thanks for checking! Now at least we know that the request handler doesn't seem to play a part in this. I need to backlog this for the moment due to v8 being the top priority. Which is unfortunate for everyone still on v7, so sorry for that. Also thanks for the reproduction, it'll be for sure helpful once we take another look at this. |
Hey, we've released v8.0.0 of the SDK, which has a new instrumentation API. Could you give that a try, and see if the memory leak is gone? You can find info on how to update here: https://docs.sentry.io/platforms/javascript/guides/node/migration/v7-to-v8/ |
This issue has gone three weeks without activity. In another week, I will close it. But! If you comment or otherwise update it, I will reset the clock, and if you remove the label "A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀 |
Is there an existing issue for this?
How do you use Sentry?
Self-hosted/on-premise
Which SDK are you using?
@sentry/node
SDK Version
7.113.0
Framework Version
nitro latest
Link to Sentry event
No response
SDK Setup
Steps to Reproduce
reproducible example
This is the memory footprint at the beginning and code
execute pnpm test, then wait for the number to reach 5000.
you can see that the memory footprint has not decreased
many instances created by sentry are not released

Then I looked at the source code, Modified my code


It's very clean,
I think here in the code but less clear action, I don't know if changing here will cause other effects
sentry-javascript/packages/node/src/handlers.ts
Line 106 in f185332
Expected Result
There should be no risk of memory leaks
Actual Result
Many internal instances of sentry are not released
The text was updated successfully, but these errors were encountered: