Memory leak when using a C++ module for Python

Jaume Bonet jaume.bonet at gmail.com
Wed Dec 10 18:09:48 EST 2008


Hi,

I'm pretty new in python programming.

I've been developing a C++ module for a python application that simply
gets the information from python, makes the last processing (which is
very time consuming -that's why I make it in C++-).

When I test the code from C++ each time I delete a vector the consumed
memory decreases, but it does not happen when the module is called
from python. The memory is kept... Once the data comes from python,
the PyObjects are read and its information passed to C objects (that
is done just once) and all the rest of the processing is done with
those objects.

I've read that the even when you delete the content of the vectors the
memory is not freed when you are working with python. Is that so?

Is there any way to really free that memory?

Thanks,
J



More information about the Python-list mailing list