Python: Performance test, ensuring cleanup
<p>I am executing some performance tests on a messaging framework within python, and I am trying to make sure that the code is properly cleaning up after itself.</p>

<p>Is there a way to monitor the current number of threads owned by the process?  Is there a better way to tell if I am leaking threads?</p>

<hr>

<p>Just to make sure I clarify what I am looking for  as an answer.  I need a script and or program that can monitor the number of threads that a process has alive.</p>
