[C++-sig] Memory Leaks In VS.NET 2003 With BOOST_PYTHON_MODULE
Matthew B. Keyes
Keyes at simcrest.com
Mon Oct 10 21:32:04 CEST 2005
Thanks tons again for the help! Needless to say, that will save me from
pulling my hair out over this :)
"Ralf W. Grosse-Kunstleve" <rwgk at yahoo.com> wrote in message
news:<20051010190642.45158.qmail at web31502.mail.mud.yahoo.com>...
> --- mjkeyes at sbcglobal.net wrote:
> > Ralf (et. al),
> > (note - I hope my newsgroup reader doesn't wrap all this in one
> > I've been playing around with this and I'm still thinking boost
> > memory in an embedded and extended application. I use Visual Leak
> > Detector 1.0 to track memory leaks, and here is where the leak comes
> > from (in my code):
> > ...
> > If I insert VLDDisable() before this class_ block and VLDEnable()
> > (which temporarily disables the leak detection for this function
> > I get zero leaks. With it turned on, here is what I see (repeated
> > times):
> > ...
> > .h (153): init_module_PyInputHandler
> > 0x10006C2B (File and line number not available):
> > boost::python::detail::exception_handler::operator=
> > 0x1000EC23 (File and line number not available):
> > boost::python::detail::init_module
> > 0x1E0682B1 (File and line number not available):
> > 0x48747570 (File and line number not available): (Function name
> > unavailable)
> > Data:
> > ... (whatever data leaked)
> I believe these leaks are not actually leaks, but a documented
> (http://www.boost.org/libs/python/todo.html) feature of Boost.Python,
> connected to the lack of support for PyFinalize(). I think what you
> as leaks are actually just entries in the global converter registry.
> one-time static allocations. Since you cannot dlopen the same module
> times there is no danger that these allocations become a real problem.
> See also: boost/libs/python/src/converter/registry.cpp
> Why is PyFinalize() support missing? -- Simply because the groups who
> money into Boost.Python development had no interest in embedding.
> To find real leaks, please consider my very simple approach of calling
> with the suspected problem in an infinite loop while monitoring the
> allocation of the process. Simple, quick, very effective, works the
same on all
> platforms. I've done it many times, coincidentally a couple of days
> testing new low-level code. I didn't see any real leaks.
> Yahoo! Music Unlimited
> Access over 1 million songs. Try it free.
More information about the Cplusplus-sig