-
Notifications
You must be signed in to change notification settings - Fork 475
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
Memory leak during exception logging #3165
Comments
Hey @vgrytsun, thanks for bringing this up. The open reference is held by the |
@sentrivana thank you for a quick response! So the workaround is to disable |
@vgrytsun You could disable the TBH I'm not sure if the event is in general a lighter object than an exception, my gut feeling is that it's usually the other way around. What kind of exceptions are you seeing that are so big? |
Exception has a reference to traceback instance, which holds stack frames and their local variables. And those local variables could be arbitrary sizes depending on the application. So for the memory intensive app it could cause perf degradation or out of memory crashes. |
We can definitely investigate whether we need to keep the whole exception or if the event or just some part of the exception would be enough. 👍🏻 |
When using
logging.exception
sentry does not release exception instance, which results in the memory leak. Exception could be pretty heavy, so depending on the app, it could even cause an OOM.In the code above, with sentry OFF, exception is garbage collected almost immediately, with sentry ON it stays around even after sentry is forced to flush all the events.
It seems like pretty severe issue, so curious if there is any workaround.
Version 2.5
The text was updated successfully, but these errors were encountered: