>> However, my scripts are getting killed due to excessive memory
> I see what you mean. It is disastrous. As far as I can see,
> the problem is inherent in the way the C routines were
> wrapped, and cannot be solved with a few Py_XDECREFs. Today
> I started working on a thorough rewrite of the wrapper,
> using a different approach from the original. It's too
> early to say when or whether I will be successful.
Eric provided a patch for this leak which is now in CVS -- contour
users may want to give it a test drive.