Memory leaks in Boost.Python

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Memory leaks in Boost.Python

tstein_dontspam
Hi,

(Environment: boost 1.32.0, python 2.4.3, VS 7.1, Windows XP)

i just wanted to utilize boost.python and started by wrapping a very simple class. To my disappointment, this simple setup produces a large amount of memory leaks.
I compiled boost, python and my module in the "Debug" configuration, so the indicated memory leaks should not stem from the collision of debug/realease msvcrt's. (If it matters: The dll was generated as 'regular dll' by the VS7 studio wizard)
Could someone tell my what i am doing wrong?

I append the core of my module, the python test program as well as the start of the debug output of VS7 (i don't think the whole output is of interest here...)

regards, Thomas

************************************************************************************************************
#pragma once

class DI_UUCLDUMMY CUnitMgrDummy
{
public:
        CUnitMgrDummy(void){};
        virtual ~CUnitMgrDummy(void){};
        void Initialize(void){};
};

#ifdef _DEBUG
# pragma comment(linker, "/defaultLib:R:/ExternalProducts/Python-2.4.3/PCbuild/python24_D.lib")
# pragma comment(linker, "/defaultLib:R:/ExternalProducts/boost_1_32_0/bin/boost/libs/python/build/boost_python.dll/vc-7_1/debug-python/threading-multi/boost_python-vc71-mt-gy-1_32.lib")
# define BOOST_DEBUG_PYTHON
#else
# pragma comment(linker, "/defaultLib:R:/ExternalProducts/Python-2.4.3/PCbuild/python24.lib")
# pragma comment(linker, "/defaultLib:R:/ExternalProducts/boost_1_32_0/bin/boost/libs/python/build/boost_python.dll/vc-7_1/release/threading-multi/boost_python-vc71-mt-1_32.lib")
#endif

#include <r:/externalproducts/boost_1_32_0/boost/python.hpp>
using namespace boost::python;

BOOST_PYTHON_MODULE(UUCLDummy)
{
    class_<CUnitMgrDummy>("UnitMgrDummy")
                .def("Initialize", &CUnitMgrDummy::Initialize)
    ;
}
********************************************************************************************************************
import sys
sys.path.append("r:ifacedll")
import UUCLDummy
c = UUCLDummy.UnitMgrDummy()
c.Initialize()
********************************************************************************************************************
'python_d.exe': Loaded 'R:ExternalProductsPython-2.4.3PCbuildpython_d.exe', Symbols loaded.
'python_d.exe': Loaded 'C:WINDOWSsystem32ntdll.dll', No symbols loaded.
'python_d.exe': Loaded 'C:WINDOWSsystem32kernel32.dll', No symbols loaded.
'python_d.exe': Loaded 'R:ExternalProductsPython-2.4.3PCbuildpython24_d.dll', Symbols loaded.
'python_d.exe': Loaded 'C:WINDOWSsystem32user32.dll', No symbols loaded.
'python_d.exe': Loaded 'C:WINDOWSsystem32gdi32.dll', No symbols loaded.
'python_d.exe': Loaded 'C:WINDOWSsystem32advapi32.dll', No symbols loaded.
'python_d.exe': Loaded 'C:WINDOWSsystem32rpcrt4.dll', No symbols loaded.
'python_d.exe': Loaded 'C:WINDOWSsystem32shell32.dll', No symbols loaded.
'python_d.exe': Loaded 'C:WINDOWSsystem32msvcrt.dll', No symbols loaded.
'python_d.exe': Loaded 'C:WINDOWSsystem32shlwapi.dll', No symbols loaded.
'python_d.exe': Loaded 'C:WINDOWSsystem32msvcr71d.dll', Symbols loaded.
'python_d.exe': Loaded 'C:WINDOWSWinSxSx86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9comctl32.dll', No symbols loaded.
'python_d.exe': Loaded 'C:WINDOWSsystem32comctl32.dll', No symbols loaded.
'python_d.exe': Loaded 'R:ifaceDllUUCLDummy_d.dll', Symbols loaded.
'python_d.exe': Loaded 'C:WINDOWSsystem32mfc71d.dll', Symbols loaded.
'python_d.exe': Loaded 'C:WINDOWSsystem32oleaut32.dll', No symbols loaded.
'python_d.exe': Loaded 'C:WINDOWSsystem32ole32.dll', No symbols loaded.
'python_d.exe': Loaded 'R:ifaceDllboost_python-vc71-mt-gy-1_32.dll', Symbols loaded.
'python_d.exe': Loaded 'C:WINDOWSsystem32msvcp71d.dll', Symbols loaded.
'python_d.exe': Loaded 'C:WINDOWSsystem32MFC71DEU.DLL', No symbols loaded.
Detected memory leaks!
Dumping objects ->
{1037} normal block at 0x00A14178, 44 bytes long.
 Data: <@   (       (W  > 40 F7 9D 00 28 89 9E 00 01 00 00 00 28 57 AA 00
{1036} normal block at 0x00A14130, 8 bytes long.
 Data: <        > E4 E6 02 10 DE 18 01 10
{1035} normal block at 0x00A13F60, 400 bytes long.
 Data: <                > 00 00 01 80 FB FB FB FB 00 00 00 00 00 00 00 00
{1034} normal block at 0x00A13D90, 400 bytes long.
 Data: <                > 00 00 01 80 FB FB FB FB 00 00 00 00 00 00 00 00
{1033} normal block at 0x00A13BC0, 400 bytes long.
...
<snip>
...
 Data: <                > 00 00 06 00 FB FB FB FB 00 00 00 00 00 00 00 00
{58} normal block at 0x00952D98, 400 bytes long.
 Data: <                > 00 00 01 80 FB FB FB FB 00 00 00 00 00 00 00 00
{55} normal block at 0x00952D18, 64 bytes long.
 Data: <h               > 68 00 96 00 10 20 9B 00 CD CD CD CD CD CD CD CD
{54} normal block at 0x00960068, 262144 bytes long.
 Data: <                > CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD
{52} normal block at 0x00954F78, 12 bytes long.
 Data: <            > FF FF FF FF 00 00 00 00 C8 0F 00 00
Object dump complete.
The program '[2800] python_d.exe: Native' has exited with code 0 (0x0).





"Jetzt Handykosten senken mit klarmobil - 14 Ct./Min.! Hier klicken"
http://www.klarmobil.de/index.html?pid=73025



-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
<a href="http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642">http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642
_______________________________________________
Boost-langbinding mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/boost-langbinding
Reply | Threaded
Open this post in threaded view
|

Re: Memory leaks in Boost.Python

thomas_steinkamp
MessageHi,

i have to withdraw my first hypothesis, not Boost.Python is leaking, Python itself seems to be the one. A rather simple module written in C produces leak messages in a similar amount. Some digging around reveals that the penomenon is not really unknown. Sorry that i bothered the wrong audience.

Thomas

----- original Nachricht --------

Betreff: [Boost-langbinding] Memory leaks in Boost.Python Gesendet: Sa 22 Apr 2006 00:16:11 CEST Von: [hidden email] >

--- original Nachricht Ende ----

--