Re: [Boost-users] [test] detect_memory_leak option in msvc 8
I am trying to get the --detect_memory_leak=1 option to detect a memory leak in my code.
Hi!
In MSVC 7.0 the memory leak detection is somewhat primitive (I don't
know about MSVC 8). I'm using Boost.Test together with mpatrol and it
works great! Here is the output of a test run:
Thanks for the info.
I got it to work by linking against the debug version of the UTF library.
Chris
On 3/26/07, KLINIK Markus SDI2-G (AREVA NP GmbH)
I am trying to get the --detect_memory_leak=1 option to detect a memory leak in my code.
Hi!
In MSVC 7.0 the memory leak detection is somewhat primitive (I don't know about MSVC 8). I'm using Boost.Test together with mpatrol and it works great! Here is the output of a test run:
top 4 unfreed memory entries in leak table: bytes count location -------- ------ -------- 400 1 d:\[snip]\unittests\test_config.cpp line 10 84 1 d:\[snip]\tcpstream\src\myenv.cc line 145 24 1 c:\src\boost_1_33_1\libs\thread\src\mutex.inl line 55 8 1 c:\src\boost_1_33_1\libs\thread\src\tss_hooks.cpp line 29 516 4 total
NB. The first memory leak is intentional, the second is a resource leak from cppadvio. It also detects the already discussed resource leaks in Boost.Treads :)
I needed some try-and-error to find the correct versions of mpatrol, Boost.Test and the windows runtime library, but now that it works, it is incredibly useful. (/MDd, mpatrolmt.dll, libboost_unit_test_framework-vc7-mt-gd.lib)
Just for comparison, here is the output of the MSVC 7.0 memory leak detection of the same code:
Detected memory leaks! Dumping objects -> {11225} normal block at 0x00F3AA60, 24 bytes long. Data: < > 18 EE 14 00 FF FF FF FF 00 00 00 00 00 00 00 00 {11224} normal block at 0x00F3BBB0, 8 bytes long. Data: <` > 60 AA F3 00 01 CD CD CD {201} normal block at 0x00F35F90, 400 bytes long. Data: < > CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD {147} normal block at 0x00F35880, 84 bytes long. Data: < =b > 10 3D 62 00 00 00 00 00 00 00 00 00 FF FF FF FF Object dump complete. Best regards Markus Klinik _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
participants (2)
-
Chris Weed
-
KLINIK Markus SDI2-G (AREVA NP GmbH)