-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Object leak in logging panel when using threads #906
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
so you have any implementation plan with tests? |
vbaltrusaitis-reef
added a commit
to vbaltrusaitis-reef/cookiecutter-rt-django
that referenced
this issue
Aug 12, 2022
debug_toolbar version 3.2.1 causes a memory leak in one of our projects. This leak happens even if the toolbar is never used, never added to urlpatterns and DEBUG is set to False. The import is enough. Newer toolbar versions don't cause this particular problem, but I'm still making the import condition just in case. See: https://github.com/vbaltrusaitis-reef/memleak-demo django-commons/django-debug-toolbar#906
matthiask
added a commit
to matthiask/django-debug-toolbar
that referenced
this issue
Jan 20, 2023
Closes django-commons#1683, closes django-commons#1681, closes django-commons#1119, closes django-commons#906, closes django-commons#695.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
I recently tracked down a memory leak in our app, which turned out to be caused by the debug toolbar.
Our Django app launches and destroys a thread in the context of a view (to talk to a websocket server). When that thread writes to logs, debug_toolbar creates a reference to the Thread instance which it never clears. Disabling DEBUG makes no difference.
Essentially this call only clears the view thread, and not any sub-threads that may have been created in the view.
I think you might want to make
_records
inLoggingPanel
a weak key dictionary, if I have understood the code correctly...The text was updated successfully, but these errors were encountered: