[C++-sig] Boost.Python Memory Leaks?

Ralf W. Grosse-Kunstleve rwgk at yahoo.com
Thu Jun 28 05:39:14 CEST 2007


This has come up many times before: Boost.Python doesn't support PyFinalize(). There is no way to cleanup the global type conversion registry. It wasn't on the agenda of the people funding Boost.Python version 2 development (i.e. embedding wasn't on the list of things considered important).
The leaks are harmless. Just don't use PyFinalize() and ignore the memory occupied by the few globals Boost.Python instantiates.
My way of finding "real" leaks is very simple: wrap your code in an endless loop and monitor the process with the top command (Linux or OSX). Let it run for a couple of hours and check again. I've done this many times (to check my own new C++ code). There are no "real" leaks in Python or Boost.Python.
Ralf





      ____________________________________________________________________________________
Shape Yahoo! in your own image.  Join our Network Research Panel today!   http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20070627/fcff2b26/attachment.htm>


More information about the Cplusplus-sig mailing list