Really Python leaks?

Barry A. Warsaw barry at digicool.com
Thu Jul 19 00:37:49 EDT 2001


>>>>> "DC" == Dave Cole <djc at object-craft.com.au> writes:

    DC> I know that my extension modules leak a bit due to objects
    DC> which are created when the module is imported and stick around
    DC> for the lifetime of the module.  I had not given it much
    DC> thought.

I don't think such allocs should be considered leaks worth worrying
about, if they're leaks at all.  If there's a good reason for those
objects to stick around for the life of the module, then you might as
well let the normal process shutdown free them implicitly.  I don't
believe Python will dlclose your extension module even on a reload
(assuming it's a dynamic library; if it's statically compiled, you
won't get finalized anyway until the process exits).

-Barry




More information about the Python-list mailing list