c++ - Intel Inspector reports std::mutex memory leaks -
intel inspector reports internal memory leak simplest std::mutex examples:
// std_mutex_test.cpp : defines entry point console application. // #include "stdafx.h" #include <iostream> #include "testmutex.h" int _tmain(int argc, _tchar* argv[]) { std::cout << "starting\n"; ctestmutex testmutex; (int = 0; < 10; i++) testmutex.dostuff(); std::cout << "done\npress key...\n"; getchar(); return 0; } // testmutex.h : class testing mutex // #include "stdafx.h" #include "testmutex.h" class ctestmutex { private: std::mutex mtx1; long sharedstuff; // example testing mutex, otherwise use atomic here public: ctestmutex() { sharedstuff = 0; } ~ctestmutex(); void ctestmutex::dostuff() { mtx1.lock(); sharedstuff++; mtx1.unlock(); } };
intel inspector xe 2013 report follows:
id type sources modules object size state p1 kernel resource leak schedulerbase.cpp std_mutex_test.exe new p2 memory leak cachelocalschedulegroup.h std_mutex_test.exe 304 new p3 memory leak collections.h std_mutex_test.exe 7168 new p4 memory leak collections.h std_mutex_test.exe 84 new p5 memory leak collections.h std_mutex_test.exe 14336 new p6 memory leak collections.h std_mutex_test.exe 4 new p7 memory leak collections.h std_mutex_test.exe 56 new p8 memory leak collections.h std_mutex_test.exe 12 new p9 memory leak collections.h std_mutex_test.exe 96 new p10 memory leak collections.h std_mutex_test.exe 49192 new p11 memory leak collections.h std_mutex_test.exe 288 new p12 memory leak contextbase.h std_mutex_test.exe 16 new p13 memory leak externalcontextbase.cpp std_mutex_test.exe 28 new p14 memory leak mailbox.h std_mutex_test.exe 44 new p15 memory leak mailbox.h std_mutex_test.exe 256 new p16 memory leak resourcemanager.cpp std_mutex_test.exe 12 new p17 memory leak resourcemanager.cpp std_mutex_test.exe 44 new p18 memory leak resourcemanager.cpp std_mutex_test.exe 52 new p19 memory leak resourcemanager.cpp std_mutex_test.exe 416 new p20 memory leak resourcemanager.cpp std_mutex_test.exe 208 new p21 memory leak resourcemanager.cpp std_mutex_test.exe 144 new p22 memory leak resourcemanager.cpp std_mutex_test.exe 64 new p23 memory leak rminternal.h std_mutex_test.exe 64 new p24 memory leak rminternal.h std_mutex_test.exe 8 new p25 memory leak rminternal.h std_mutex_test.exe 292 new p26 memory leak schedulerbase.cpp std_mutex_test.exe 176 new p27 memory leak schedulerbase.cpp std_mutex_test.exe 56 new p28 memory leak schedulerbase.cpp std_mutex_test.exe 20 new p29 memory leak schedulerbase.cpp std_mutex_test.exe 4 new p30 memory leak schedulerbase.cpp std_mutex_test.exe 4 new p31 memory leak schedulerbase.cpp std_mutex_test.exe 192 new p32 memory leak schedulerbase.cpp std_mutex_test.exe 136 new p33 memory leak schedulerbase.cpp std_mutex_test.exe 1024 new p34 memory leak schedulerpolicybase.cpp std_mutex_test.exe 40 new p35 memory leak schedulerproxy.cpp std_mutex_test.exe 2104 new p36 memory leak schedulerproxy.cpp std_mutex_test.exe 4 new p37 memory leak schedulerproxy.cpp std_mutex_test.exe 704 new p38 memory leak structuredworkstealingqueue.h std_mutex_test.exe 2048 new p39 memory leak structuredworkstealingqueue.h std_mutex_test.exe 4096 new p40 memory leak threadscheduler.cpp std_mutex_test.exe 520 new p41 memory leak threadscheduler.cpp std_mutex_test.exe 1664 new p42 memory not deallocated trace.cpp std_mutex_test.exe 24 new
is there i'm doing wrong here, or these known kernel internal memory leaks have no control over?
compiled example using intel c++ compiler using multi-threaded debug /mtd flag, running visual studio 2012 update 3 on windows 7 latest updates.
std::lock_guard
leaks memory:
void ctestmutex::dostuff() { std::lock_guard<std::mutex> lock(mtx1); sharedstuff++; }
intel inspector xe 2013 std::lock_guard
report:
id type sources modules object size state p1 kernel resource leak schedulerbase.cpp std_mutex_test.exe not fixed p2 memory leak cachelocalschedulegroup.h std_mutex_test.exe 304 not fixed p3 memory leak collections.h std_mutex_test.exe 7168 not fixed p4 memory leak collections.h std_mutex_test.exe 84 not fixed p5 memory leak collections.h std_mutex_test.exe 14336 not fixed p6 memory leak collections.h std_mutex_test.exe 4 not fixed p7 memory leak collections.h std_mutex_test.exe 56 not fixed p8 memory leak collections.h std_mutex_test.exe 12 not fixed p9 memory leak collections.h std_mutex_test.exe 96 not fixed p10 memory leak collections.h std_mutex_test.exe 49192 not fixed p11 memory leak collections.h std_mutex_test.exe 288 not fixed p12 memory leak contextbase.h std_mutex_test.exe 16 not fixed p13 memory leak externalcontextbase.cpp std_mutex_test.exe 28 not fixed p14 memory leak mailbox.h std_mutex_test.exe 44 not fixed p15 memory leak mailbox.h std_mutex_test.exe 256 not fixed p16 memory leak resourcemanager.cpp std_mutex_test.exe 12 not fixed p17 memory leak resourcemanager.cpp std_mutex_test.exe 44 not fixed p18 memory leak resourcemanager.cpp std_mutex_test.exe 52 not fixed p19 memory leak resourcemanager.cpp std_mutex_test.exe 416 not fixed p20 memory leak resourcemanager.cpp std_mutex_test.exe 208 not fixed p21 memory leak resourcemanager.cpp std_mutex_test.exe 144 not fixed p22 memory leak resourcemanager.cpp std_mutex_test.exe 64 not fixed p23 memory leak rminternal.h std_mutex_test.exe 64 not fixed p24 memory leak rminternal.h std_mutex_test.exe 8 not fixed p25 memory leak rminternal.h std_mutex_test.exe 292 not fixed p26 memory leak schedulerbase.cpp std_mutex_test.exe 176 not fixed p27 memory leak schedulerbase.cpp std_mutex_test.exe 56 not fixed p28 memory leak schedulerbase.cpp std_mutex_test.exe 20 not fixed p29 memory leak schedulerbase.cpp std_mutex_test.exe 4 not fixed p30 memory leak schedulerbase.cpp std_mutex_test.exe 4 not fixed p31 memory leak schedulerbase.cpp std_mutex_test.exe 192 not fixed p32 memory leak schedulerbase.cpp std_mutex_test.exe 136 not fixed p33 memory leak schedulerbase.cpp std_mutex_test.exe 1024 not fixed p34 memory leak schedulerpolicybase.cpp std_mutex_test.exe 40 not fixed p35 memory leak schedulerproxy.cpp std_mutex_test.exe 2104 not fixed p36 memory leak schedulerproxy.cpp std_mutex_test.exe 4 not fixed p37 memory leak schedulerproxy.cpp std_mutex_test.exe 704 not fixed p38 memory leak structuredworkstealingqueue.h std_mutex_test.exe 2048 not fixed p39 memory leak structuredworkstealingqueue.h std_mutex_test.exe 4096 not fixed p40 memory leak threadscheduler.cpp std_mutex_test.exe 520 not fixed p41 memory leak threadscheduler.cpp std_mutex_test.exe 1664 not fixed p42 memory not deallocated trace.cpp std_mutex_test.exe 24 not fixed
Comments
Post a Comment