Coroutines, and memory leaks

David Given dg at pearl.tao.co.uk
Mon Mar 5 12:18:00 EST 2001


Two questions here. Both this relate to a project I'm currently working
on, a Gnome MUA written in Python (see http://sqmail.sourceforge.net).

1. Does Python do coroutines?

Reason: at one part of the program I want to run a command-line-like
routine, that processes and emits log messages at intervals. I want to
display the result in a window. The most elegant way of connecting this
routine to GTK is to put them in different threads; but since I don't need
true concurrency, coroutines would be the simplest solution.

2. I have this massive memory leak. How can I find it?

The more I use the program, the more memory it uses. I've seen it use
>100MB before I killed it. I guess that I've got cyclic memory structures
in the message cache, so it's never freeing any of the mail I look at. Are
there any suggestions for how I can find these and kill them?

-- 
+- David Given ---------------McQ-+ "Opportunity is missed by most people
|  Work: dg at tao-group.com         | because it's dressed in overalls and looks
|  Play: dgiven at iname.com         | like work." --- Thomas Edison              
+- http://wired.st-and.ac.uk/~dg -+ 



More information about the Python-list mailing list