Py_Finalize

Pablo Yabo pyabo at novamens.com
Fri Feb 20 10:09:42 EST 2004


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.

----- Original Message ----- 
From: "Gerhard Häring" <gh at ghaering.de>
To: <python-list at python.org>
Sent: Friday, February 20, 2004 11:02 AM
Subject: Re: Py_Finalize


> Pablo Yabo wrote:
> > Hi,
> > I embeded Python in a C++ application to support some scripts. I start
it
> > using Py_Initialize() and after using running the scripts I call
> > Py_Finalize(). The problem that I experienced is that the memory usage
of
> > the process doesn't decrease after the Py_Finalize().
> > If I call again Py_Initialize() and then load some modules, the memory
usage
> > increase, but it never decrease when calling Py_Finalize().
> > How can I do a complete cleanup of the python heap?
>
> Chances are everything is working fine, but your C library isn't returning
freed
> memory to the operating system.
>
> Try runnnig Py_Initialize()/your scripts/Py_Finalize() in a loop. If
memory usage
> doesn't increase above a certain maximum, then you don't have any leaks.
>
> -- Gerhard
>
> -- 
> http://mail.python.org/mailman/listinfo/python-list






More information about the Python-list mailing list