Memory leak in MultiThread
Posted: Wed Jul 06, 2011 2:53 am
I have use multi-thread collision . coding like MultiThreadedDemo.
but msvc (or VLD) can detect some memory leaks in MultiThreaded mode.
I also tested MultiThreadedDemo with VLD.but leak detected much more.
here is the leak log in my project:
WARNING: Visual Leak Detector detected memory leaks!
---------- Block 36 at 0x01F7EAB8: 91 bytes ----------
Call Stack:
c:\developer\support\bullet-2.78\src\linearmath\btalignedallocator.cpp (24): MyBullet.dll!btAllocDefault + 0xC bytes
c:\developer\support\bullet-2.78\src\linearmath\btalignedallocator.cpp (67): MyBullet.dll!btAlignedAllocDefault + 0x13 bytes
c:\developer\support\bullet-2.78\src\linearmath\btalignedallocator.cpp (164): MyBullet.dll!btAlignedAllocInternal + 0x10 bytes
c:\developer\support\bullet-2.78\src\bulletmultithreaded\win32threadsupport.cpp (429): MyBullet.dll!Win32ThreadSupport::createBarrier + 0x9 bytes
c:\developer\support\bullet-2.78\src\bulletmultithreaded\btparallelconstraintsolver.cpp (995): MyBullet.dll!btParallelConstraintSolver::btParallelConstraintSolver + 0x19 bytes
Data:
CD CD CD CD B8 EA F7 01 B0 BF C9 03 58 C7 2C 00 ........ ....X.,.
FF FF FF FF 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
00 00 00 00 F8 A4 ED 07 FF FF FF FF 00 00 00 00 ........ ........
00 00 00 00 00 00 00 00 00 00 00 00 FC 01 00 00 ........ ........
00 02 00 00 00 00 00 00 00 00 00 00 02 00 00 00 ........ ........
CD CD CD CD CD CD CD CD CD CD CD ........ ........
---------- Block 37 at 0x08CE12A8: 195 bytes ----------
Call Stack:
c:\developer\support\bullet-2.78\src\linearmath\btalignedallocator.cpp (24): MyBullet.dll!btAllocDefault + 0xC bytes
c:\developer\support\bullet-2.78\src\linearmath\btalignedallocator.cpp (67): MyBullet.dll!btAlignedAllocDefault + 0x13 bytes
c:\developer\support\bullet-2.78\src\linearmath\btalignedallocator.cpp (164): MyBullet.dll!btAlignedAllocInternal + 0x10 bytes
c:\developer\support\bullet-2.78\src\bulletmultithreaded\win32threadsupport.cpp (437): MyBullet.dll!Win32ThreadSupport::createCriticalSection + 0xC bytes
c:\developer\support\bullet-2.78\src\bulletmultithreaded\btparallelconstraintsolver.cpp (996): MyBullet.dll!btParallelConstraintSolver::btParallelConstraintSolver + 0x19 bytes
Data:
CD CD CD CD A8 12 CE 08 D8 BF C9 03 CD CD CD CD ........ ........
CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD ........ ........
CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD ........ ........
CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD ........ ........
CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD ........ ........
CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD ........ ........
CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD ........ ........
CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD ........ ........
CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD ........ ........
CD CD CD CD CD CD CD CD 30 A5 ED 07 FF FF FF FF ........ 0.......
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD ........ ........
CD CD CD ........ ........
---------- Block 28 at 0x08D4D190: 23168 bytes ----------
Call Stack:
f:\vs70builds\3077\vc\crtbld\crt\src\newop.cpp (12): MyBullet.dll!operator new + 0x9 bytes
c:\developer\support\bullet-2.78\src\bulletmultithreaded\spunarrowphasecollisiontask\spugatheringcollisiontask.cpp (196): MyBullet.dll!createCollisionLocalStoreMemory + 0xA bytes
c:\developer\support\bullet-2.78\src\bulletmultithreaded\win32threadsupport.cpp (268): MyBullet.dll!Win32ThreadSupport::startThreads + 0x8 bytes
c:\developer\support\bullet-2.78\src\bulletmultithreaded\win32threadsupport.cpp (37): MyBullet.dll!Win32ThreadSupport::Win32ThreadSupport
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
---------- Block 29 at 0x08D52C50: 23168 bytes ----------
Call Stack:
f:\vs70builds\3077\vc\crtbld\crt\src\newop.cpp (12): MyBullet.dll!operator new + 0x9 bytes
c:\developer\support\bullet-2.78\src\bulletmultithreaded\spunarrowphasecollisiontask\spugatheringcollisiontask.cpp (196): MyBullet.dll!createCollisionLocalStoreMemory + 0xA bytes
c:\developer\support\bullet-2.78\src\bulletmultithreaded\win32threadsupport.cpp (268): MyBullet.dll!Win32ThreadSupport::startThreads + 0x8 bytes
c:\developer\support\bullet-2.78\src\bulletmultithreaded\win32threadsupport.cpp (37): MyBullet.dll!Win32ThreadSupport::Win32ThreadSupport
Data:
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
Visual Leak Detector detected 4 memory leaks.
Visual Leak Detector is now exiting.
Detected memory leaks!
Dumping objects ->
{7019} normal block at 0x08CE12A8, 195 bytes long.
Data: < > CD CD CD CD A8 12 CE 08 D8 BF C9 03 CD CD CD CD
{7018} normal block at 0x01F7EAB8, 91 bytes long.
Data: < X , > CD CD CD CD B8 EA F7 01 B0 BF C9 03 58 C7 2C 00
{7008} normal block at 0x08D52C50, 23168 bytes long.
Data: < > 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
{7007} normal block at 0x08D4D190, 23168 bytes long.
Data: < > 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Object dump complete.
but msvc (or VLD) can detect some memory leaks in MultiThreaded mode.
I also tested MultiThreadedDemo with VLD.but leak detected much more.
here is the leak log in my project:
WARNING: Visual Leak Detector detected memory leaks!
---------- Block 36 at 0x01F7EAB8: 91 bytes ----------
Call Stack:
c:\developer\support\bullet-2.78\src\linearmath\btalignedallocator.cpp (24): MyBullet.dll!btAllocDefault + 0xC bytes
c:\developer\support\bullet-2.78\src\linearmath\btalignedallocator.cpp (67): MyBullet.dll!btAlignedAllocDefault + 0x13 bytes
c:\developer\support\bullet-2.78\src\linearmath\btalignedallocator.cpp (164): MyBullet.dll!btAlignedAllocInternal + 0x10 bytes
c:\developer\support\bullet-2.78\src\bulletmultithreaded\win32threadsupport.cpp (429): MyBullet.dll!Win32ThreadSupport::createBarrier + 0x9 bytes
c:\developer\support\bullet-2.78\src\bulletmultithreaded\btparallelconstraintsolver.cpp (995): MyBullet.dll!btParallelConstraintSolver::btParallelConstraintSolver + 0x19 bytes
Data:
CD CD CD CD B8 EA F7 01 B0 BF C9 03 58 C7 2C 00 ........ ....X.,.
FF FF FF FF 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
00 00 00 00 F8 A4 ED 07 FF FF FF FF 00 00 00 00 ........ ........
00 00 00 00 00 00 00 00 00 00 00 00 FC 01 00 00 ........ ........
00 02 00 00 00 00 00 00 00 00 00 00 02 00 00 00 ........ ........
CD CD CD CD CD CD CD CD CD CD CD ........ ........
---------- Block 37 at 0x08CE12A8: 195 bytes ----------
Call Stack:
c:\developer\support\bullet-2.78\src\linearmath\btalignedallocator.cpp (24): MyBullet.dll!btAllocDefault + 0xC bytes
c:\developer\support\bullet-2.78\src\linearmath\btalignedallocator.cpp (67): MyBullet.dll!btAlignedAllocDefault + 0x13 bytes
c:\developer\support\bullet-2.78\src\linearmath\btalignedallocator.cpp (164): MyBullet.dll!btAlignedAllocInternal + 0x10 bytes
c:\developer\support\bullet-2.78\src\bulletmultithreaded\win32threadsupport.cpp (437): MyBullet.dll!Win32ThreadSupport::createCriticalSection + 0xC bytes
c:\developer\support\bullet-2.78\src\bulletmultithreaded\btparallelconstraintsolver.cpp (996): MyBullet.dll!btParallelConstraintSolver::btParallelConstraintSolver + 0x19 bytes
Data:
CD CD CD CD A8 12 CE 08 D8 BF C9 03 CD CD CD CD ........ ........
CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD ........ ........
CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD ........ ........
CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD ........ ........
CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD ........ ........
CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD ........ ........
CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD ........ ........
CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD ........ ........
CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD ........ ........
CD CD CD CD CD CD CD CD 30 A5 ED 07 FF FF FF FF ........ 0.......
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD ........ ........
CD CD CD ........ ........
---------- Block 28 at 0x08D4D190: 23168 bytes ----------
Call Stack:
f:\vs70builds\3077\vc\crtbld\crt\src\newop.cpp (12): MyBullet.dll!operator new + 0x9 bytes
c:\developer\support\bullet-2.78\src\bulletmultithreaded\spunarrowphasecollisiontask\spugatheringcollisiontask.cpp (196): MyBullet.dll!createCollisionLocalStoreMemory + 0xA bytes
c:\developer\support\bullet-2.78\src\bulletmultithreaded\win32threadsupport.cpp (268): MyBullet.dll!Win32ThreadSupport::startThreads + 0x8 bytes
c:\developer\support\bullet-2.78\src\bulletmultithreaded\win32threadsupport.cpp (37): MyBullet.dll!Win32ThreadSupport::Win32ThreadSupport
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
---------- Block 29 at 0x08D52C50: 23168 bytes ----------
Call Stack:
f:\vs70builds\3077\vc\crtbld\crt\src\newop.cpp (12): MyBullet.dll!operator new + 0x9 bytes
c:\developer\support\bullet-2.78\src\bulletmultithreaded\spunarrowphasecollisiontask\spugatheringcollisiontask.cpp (196): MyBullet.dll!createCollisionLocalStoreMemory + 0xA bytes
c:\developer\support\bullet-2.78\src\bulletmultithreaded\win32threadsupport.cpp (268): MyBullet.dll!Win32ThreadSupport::startThreads + 0x8 bytes
c:\developer\support\bullet-2.78\src\bulletmultithreaded\win32threadsupport.cpp (37): MyBullet.dll!Win32ThreadSupport::Win32ThreadSupport
Data:
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
Visual Leak Detector detected 4 memory leaks.
Visual Leak Detector is now exiting.
Detected memory leaks!
Dumping objects ->
{7019} normal block at 0x08CE12A8, 195 bytes long.
Data: < > CD CD CD CD A8 12 CE 08 D8 BF C9 03 CD CD CD CD
{7018} normal block at 0x01F7EAB8, 91 bytes long.
Data: < X , > CD CD CD CD B8 EA F7 01 B0 BF C9 03 58 C7 2C 00
{7008} normal block at 0x08D52C50, 23168 bytes long.
Data: < > 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
{7007} normal block at 0x08D4D190, 23168 bytes long.
Data: < > 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Object dump complete.