I just finished a major rewrite of backend agg using the pycxx extension tools. Last week I presented weave to a CS class that I'm taking, and encountered cxx (which weave uses). I had seen this long ago, but hadn't looked closely at it since. Given the memory leak in agg that was discovered on matplotlib-users last week, I decided it would be easier and cleaner to use some good extension building code rather than hunt it down. The result is a much cleaner and readable backend_agg. There may be some additional small leaks to clean up (eg in image or ft2font) but if so they are likely not major. I was able to generate 2000 figures in a test run with only a small increase in memory (4% -> 8% on my system). As I get time I hope to do the image module and/or backend_gtkagg and/or ft2font. In any case CXX is very nice - it's committed to CVS - you may want to test build on your platforms of choice. Cheers, John Hunter