sentry-javascript icon indicating copy to clipboard operation
sentry-javascript copied to clipboard

Client memory leak after self-hosted Sentry goes down

Open finkrer opened this issue 3 years ago • 5 comments

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

  1. Self-host Sentry
  2. Deploy apps that depend on it
  3. Reboot the self-hosting machine
  4. 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.

image

Pictured: server reboot on October 29, memory leak after.

finkrer avatar Oct 31 '22 18:10 finkrer

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.

AbhiPrasad avatar Nov 02 '22 11:11 AbhiPrasad

Do we need to add timeouts to our transports?

lforst avatar Oct 30 '23 10:10 lforst

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.

jomarl avatar Nov 17 '23 12:11 jomarl

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.

lforst avatar Nov 20 '23 09:11 lforst

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 🥀

getsantry[bot] avatar May 16 '24 07:05 getsantry[bot]