rfk/threading2 — Issue #1: ThreadGroup references cause memory leak
Author: SyamGadde
Created: 2012-01-09 18:25:02+00:00
State: open

I don't know if you are still actively maintaining this, but I'm using threading2 and find it very useful. I think there is a problem in that the default thread group accumulates threads automatically when you don't explicitly specify a group in the Thread constructor, but they never get automatically removed from the thread group. So if you have an application that constantly creates threads (with no explicit group), these threads will never be garbage collected because the default thread group continues to hold a reference to them. My workaround is to set the group to None after I create the thread, and that removes the link between ThreadGroup and the new Thread. I'm not sure what the proper fix would be, but making the reference from ThreadGroup be "weakref"s seems most reasonable to me.