Python 2.7.3, C++ embed memory leak?

Q

Qi

Hi guys,

Is there any known memory leak problems, when embed Python 2.7.3
in C++?
I Googled but only found some old posts.

I tried to only call Py_Initialize() and Py_Finalize(), nothing else
between those functions, Valgrind still reports memory leaks
on Ubuntu?

Is that a know problem? Did Python 3.x solve it?

I want some confirmation.


Thanks
 
U

Ulrich Eckhardt

Am 29.05.2012 16:37, schrieb Qi:
I tried to only call Py_Initialize() and Py_Finalize(), nothing else
between those functions, Valgrind still reports memory leaks
on Ubuntu?

Call the pair of functions twice, if the reported memory leak doesn't
increase, there is no problem. I personally wouldn't even call this a
leak then, but that depends a bit on the precise definition.

Uli
 
Q

Qi

Call the pair of functions twice, if the reported memory leak doesn't
increase, there is no problem. I personally wouldn't even call this a
leak then, but that depends a bit on the precise definition.

I should still call it a memory leak though it seems less harmful.
And it causes trouble that I have difficulty to distinguish if
the leaks are from Python or from my binding code, if I add binding
between that pair of functions.
 
D

Diez B. Roggisch

Qi said:
Hi guys,

Is there any known memory leak problems, when embed Python 2.7.3
in C++?
I Googled but only found some old posts.

I tried to only call Py_Initialize() and Py_Finalize(), nothing else
between those functions, Valgrind still reports memory leaks
on Ubuntu?

Is that a know problem? Did Python 3.x solve it?

I want some confirmation.

Python does some special things that confuse valgrind. Don't bother.

http://svn.python.org/projects/python/trunk/Misc/README.valgrind

Diez
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top