
Hi there, Today I have noticed memory leak in thread library - libboost_thread-vc80-mt-gd-1_46_1.lib. I am using vs2005 and pure _crtdumpmemoryleaks() fires memory leak detected in boost: one 16 bytes and another 36 bytes long. I didn't build libs by my own, but used boostpro for installing 1.46.1 version. Also I can't say where is the leak since I don't have any precise memory leak cacher. Then I tried with new version libboost_thread-vc80-mt-gd-1_47.lib, but worse - it fires five memory leaks (118 bytes all). Memory leak test is pure: #include <boost/thread.hpp> int main() { _CrtDumpMemoryLeaks(); } Best Regards, Aleksandar

On Wed, Jul 13, 2011 at 05:44:03PM +0200, Aleksa Karalejic wrote:
Hi there, Today I have noticed memory leak in thread library - Memory leak test is pure:
#include <boost/thread.hpp> int main() { _CrtDumpMemoryLeaks(); }
That function only reports unfreed blocks. You're checking the state of the runtime memory in the middle of the program, while there is a lot of code that hasn't run yet (destructors of locals in main, destructors of objects with static storage duration, DLL detach procedures, etc.). The documentation for the function incidentally tells you how to use _CrtSetDbgFlag with CRTDBG_LEAK_CHECK_DF to invoke CrtDumpMemoryLeaks as late in the process termination as possible, to avoid any false positives. As they say, "it's not over until the fat lady sings." What you detect are not leaks, but most probably just resources not freed yet. -- Lars Viklund | zao@acc.umu.se
participants (2)
-
Aleksa Karalejic
-
Lars Viklund