[Python-Dev] [Python-3000] Python 3000 Sprint @ Google

Neal Norwitz nnorwitz at gmail.com
Thu Aug 16 05:13:04 CEST 2007


On 8/15/07, Bill Janssen <janssen at parc.com> wrote:
> > Sounds like a good plan. I'm not a great coach though since I didn't
> > write _ssl.c and I've never used openssl directly. But I can help you
> > with the Python stuff of course!
>
> Thanks (though I think I can handle the Python end of it, too :-).
>
> It's been a while since I wrote any Python C code, though -- are there
> better tools these days for debugging reference counting?  Anyone know?

The way I typically do it is to configure --with-pydebug.  That shows
the ref count in the interpreter and allows running tests with the -R
flag to regrtest.  When regrtest reports leaks, narrow down the
(Python) code which causes a leak using bisection, find the C code
which corresponds, and visually inspect the C code.  Most leaks are
pretty obvious this way.  With good tests, this doesn't take much
time.

For pure memory leaks, valgrind works pretty well.

n


More information about the Python-Dev mailing list