Message 304619 - Python tracker
The current code leaks memory since it never clears threads which completed. We need a cleanup function similar to ForkingMixIn.collect_children() which is called by handle_timeout() and service_actions(). We can check if a thread is alive: thread.is_alive(), to decide to remove it or not. Moreover, maybe we should keep a list of weak references?