Pablo Yabo pyabo at
Fri Feb 20 16:37:17 CET 2004

I use Py_DECREF when the module is no longer needed, but when I call
PyImport_Import the reference count of the module is 2, so after
decrementing the reference count it doesn't unload.

----- Original Message ----- 
From: "Paul Miller" <paul at>
To: "Pablo Yabo" <pyabo at>; "Gerhard Häring" <gh at>;
<python-list at>
Sent: Friday, February 20, 2004 12:22 PM
Subject: Re: Py_Finalize

> >I do that and the memory always increase.
> >If I comment the module loads the memory stay stable, but if I load the
> >modules the memory increases and never return to the previous level.
> How are you running your scripts? If using PyImport, try Py_DECREF the
> returned module objects before you call Py_Finalize.

More information about the Python-list mailing list