sentry-javascript
sentry-javascript copied to clipboard
Client memory leak after self-hosted Sentry goes down
Is there an existing issue for this?
- [X] I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- [X] I have reviewed the documentation https://docs.sentry.io/
- [X] I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases
How do you use Sentry?
Self-hosted/on-premise
Which package are you using?
@sentry/nextjs
SDK Version
7.17.3
Framework Version
Next 13.0.0, React 18.2.0, Node 14.20.1
Link to Sentry event
No response
Steps to Reproduce
- Self-host Sentry
- Deploy apps that depend on it
- Reboot the self-hosting machine
- All apps working with that server instance start leaking memory
Not a proper reproduction, I know, but it's the best I can do right now. Just want to let you know about the issue and maybe hear some advice.
Expected Result
Everything is fine.
Actual Result
Node chugs memory until we are forced to reboot the machines. Note that the leak continues indefinitely after the Sentry server becomes available again.
Pictured: server reboot on October 29, memory leak after.
Hey thanks for writing in! The memory leak is very concerning, backlogging we can investigate. In the mean time, PRs are welcome if you can identify what is causing the issue here - I suspect there is something going wrong with our transport.
Do we need to add timeouts to our transports?
We have experienced a similar issue using @sentry/nextjs (version 7.73.0). Due to high traffic to Sentry from our application the operations team blocked the network access and immediately after we started experiencing memory issues and our application containers getting OOM killed. Removing Sentry immediately solved the memory issue.
The browser integration also seemed to get affected by Sentry not being available, e.g. all interactions (browser/client only) became extremly sluggish. This could though be related to quite a lof of replay recordings beeing triggered during the same time period.
We are currently lacking reproduction for this. Are you doing any sort of manual instrumentation? The SDK might pick up variables which can't be GCd.
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 Waiting for: Community, I will leave it alone ... forever!
"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀