views:

28

answers:

1

I have python extensions implemented on c++ classes. I dont have a c++ target to run valgrind with. I want to use valgrind for memory check. Can I use valgrind with python?

A: 

Yes you can: you do have a target to run valgrind with -- it's the python interpreter itself:

valgrind python foo.py

However, the results of above may not be very satisfactory -- Python is built in opt mode and with a special malloc, which may drown you in false positives.

You'll likely get better results by first building a debug version of Python. Start here.

Employed Russian