Skip to content

Object leak in logging panel when using threads #906

Closed
@willmcgugan

Description

@willmcgugan

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 in LoggingPanel a weak key dictionary, if I have understood the code correctly...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions