<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://pybullet.org/Bullet/phpBB3/app.php/feed/topic/7005" />

	<title>Real-Time Physics Simulation Forum</title>
	
	<link href="https://pybullet.org/Bullet/phpBB3/index.php" />
	<updated>2012-06-20T01:03:52+00:00</updated>

	<author><name><![CDATA[Real-Time Physics Simulation Forum]]></name></author>
	<id>https://pybullet.org/Bullet/phpBB3/app.php/feed/topic/7005</id>

		<entry>
		<author><name><![CDATA[zerochen]]></name></author>
		<updated>2012-06-20T01:03:52+00:00</updated>

		<published>2012-06-20T01:03:52+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=28142#p28142</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=28142#p28142"/>
		<title type="html"><![CDATA[Re: Memory leak in MultiThread]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=28142#p28142"><![CDATA[
hi<br><br>yes i think your are right i found it too.<br><br>here is the patch to solve it. not sure whether its right or not but it works. maybe someone can confirm this?<br><div class="codebox"><p>Code: </p><pre><code>Index: btParallelConstraintSolver.cpp===================================================================--- btParallelConstraintSolver.cpp (Revision 2538)+++ btParallelConstraintSolver.cpp (Arbeitskopie)@@ -1002,6 +1002,8 @@{delete m_memoryCache;delete m_solverIO;+ delete m_barrier;+ delete m_criticalSection;}Index: PosixThreadSupport.cpp===================================================================--- PosixThreadSupport.cpp (Revision 2538)+++ PosixThreadSupport.cpp (Arbeitskopie)@@ -248,6 +248,9 @@destroySem(spuStatus.startSemaphore);printf("semaphore destroyed\n");checkPThreadFunction(pthread_join(spuStatus.thread,0));++ if(spuStatus.m_lsMemory)+ delete spuStatus.m_lsMemory;}printf("destroy main semaphore\n");destroySem(mainSemaphore);Index: Win32ThreadSupport.cpp===================================================================--- Win32ThreadSupport.cpp (Revision 2538)+++ Win32ThreadSupport.cpp (Arbeitskopie)@@ -299,6 +299,9 @@CloseHandle(spuStatus.m_eventCompletetHandle);CloseHandle(spuStatus.m_eventStartHandle);CloseHandle(spuStatus.m_threadHandle);++ if(spuStatus.m_lsMemory)+ delete spuStatus.m_lsMemory;}m_activeSpuStatus.clear();</code></pre></div><p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=9353">zerochen</a> — Wed Jun 20, 2012 1:03 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nsdavidlj]]></name></author>
		<updated>2011-07-06T02:53:12+00:00</updated>

		<published>2011-07-06T02:53:12+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=24089#p24089</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=24089#p24089"/>
		<title type="html"><![CDATA[Memory leak in MultiThread]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=24089#p24089"><![CDATA[
I have use multi-thread collision . coding like MultiThreadedDemo.<br>but msvc (or VLD) can detect some memory leaks in MultiThreaded mode.<br>I also tested MultiThreadedDemo with VLD.but leak detected much more.<br><br>here is the leak log in my project:<br><br>WARNING: Visual Leak Detector detected memory leaks!<br>---------- Block 36 at 0x01F7EAB8: 91 bytes ----------<br>  Call Stack:<br>    c:\developer\support\bullet-2.78\src\linearmath\btalignedallocator.cpp (24): MyBullet.dll!btAllocDefault + 0xC bytes<br>    c:\developer\support\bullet-2.78\src\linearmath\btalignedallocator.cpp (67): MyBullet.dll!btAlignedAllocDefault + 0x13 bytes<br>    c:\developer\support\bullet-2.78\src\linearmath\btalignedallocator.cpp (164): MyBullet.dll!btAlignedAllocInternal + 0x10 bytes<br>    c:\developer\support\bullet-2.78\src\bulletmultithreaded\win32threadsupport.cpp (429): MyBullet.dll!Win32ThreadSupport::createBarrier + 0x9 bytes<br>    c:\developer\support\bullet-2.78\src\bulletmultithreaded\btparallelconstraintsolver.cpp (995): MyBullet.dll!btParallelConstraintSolver::btParallelConstraintSolver + 0x19 bytes<br>  Data:<br>    CD CD CD CD    B8 EA F7 01    B0 BF C9 03    58 C7 2C 00     ........ ....X.,.<br>    FF FF FF FF    00 00 00 00    00 00 00 00    00 00 00 00     ........ ........<br>    00 00 00 00    F8 A4 ED 07    FF FF FF FF    00 00 00 00     ........ ........<br>    00 00 00 00    00 00 00 00    00 00 00 00    FC 01 00 00     ........ ........<br>    00 02 00 00    00 00 00 00    00 00 00 00    02 00 00 00     ........ ........<br>    CD CD CD CD    CD CD CD CD    CD CD CD                       ........ ........<br><br><br>---------- Block 37 at 0x08CE12A8: 195 bytes ----------<br>  Call Stack:<br>    c:\developer\support\bullet-2.78\src\linearmath\btalignedallocator.cpp (24): MyBullet.dll!btAllocDefault + 0xC bytes<br>    c:\developer\support\bullet-2.78\src\linearmath\btalignedallocator.cpp (67): MyBullet.dll!btAlignedAllocDefault + 0x13 bytes<br>    c:\developer\support\bullet-2.78\src\linearmath\btalignedallocator.cpp (164): MyBullet.dll!btAlignedAllocInternal + 0x10 bytes<br>    c:\developer\support\bullet-2.78\src\bulletmultithreaded\win32threadsupport.cpp (437): MyBullet.dll!Win32ThreadSupport::createCriticalSection + 0xC bytes<br>    c:\developer\support\bullet-2.78\src\bulletmultithreaded\btparallelconstraintsolver.cpp (996): MyBullet.dll!btParallelConstraintSolver::btParallelConstraintSolver + 0x19 bytes<br>  Data:<br>    CD CD CD CD    A8 12 CE 08    D8 BF C9 03    CD CD CD CD     ........ ........<br>    CD CD CD CD    CD CD CD CD    CD CD CD CD    CD CD CD CD     ........ ........<br>    CD CD CD CD    CD CD CD CD    CD CD CD CD    CD CD CD CD     ........ ........<br>    CD CD CD CD    CD CD CD CD    CD CD CD CD    CD CD CD CD     ........ ........<br>    CD CD CD CD    CD CD CD CD    CD CD CD CD    CD CD CD CD     ........ ........<br>    CD CD CD CD    CD CD CD CD    CD CD CD CD    CD CD CD CD     ........ ........<br>    CD CD CD CD    CD CD CD CD    CD CD CD CD    CD CD CD CD     ........ ........<br>    CD CD CD CD    CD CD CD CD    CD CD CD CD    CD CD CD CD     ........ ........<br>    CD CD CD CD    CD CD CD CD    CD CD CD CD    CD CD CD CD     ........ ........<br>    CD CD CD CD    CD CD CD CD    30 A5 ED 07    FF FF FF FF     ........ 0.......<br>    00 00 00 00    00 00 00 00    00 00 00 00    00 00 00 00     ........ ........<br>    CD CD CD CD    CD CD CD CD    CD CD CD CD    CD CD CD CD     ........ ........<br>    CD CD CD                                                     ........ ........<br><br><br>---------- Block 28 at 0x08D4D190: 23168 bytes ----------<br>  Call Stack:<br>    f:\vs70builds\3077\vc\crtbld\crt\src\newop.cpp (12): MyBullet.dll!operator new + 0x9 bytes<br>    c:\developer\support\bullet-2.78\src\bulletmultithreaded\spunarrowphasecollisiontask\spugatheringcollisiontask.cpp (196): MyBullet.dll!createCollisionLocalStoreMemory + 0xA bytes<br>    c:\developer\support\bullet-2.78\src\bulletmultithreaded\win32threadsupport.cpp (268): MyBullet.dll!Win32ThreadSupport::startThreads + 0x8 bytes<br>    c:\developer\support\bullet-2.78\src\bulletmultithreaded\win32threadsupport.cpp (37): MyBullet.dll!Win32ThreadSupport::Win32ThreadSupport<br><br>    00 00 00 00    00 00 00 00    00 00 00 00    00 00 00 00     ........ ........<br>    00 00 00 00    00 00 00 00    00 00 00 00    00 00 00 00     ........ ........<br>    00 00 00 00    00 00 00 00    00 00 00 00    00 00 00 00     ........ ........<br>    00 00 00 00    00 00 00 00    00 00 00 00    00 00 00 00     ........ ........<br>    00 00 00 00    00 00 00 00    00 00 00 00    00 00 00 00     ........ ........<br>    00 00 00 00    00 00 00 00    00 00 00 00    00 00 00 00     ........ ........<br>    00 00 00 00    00 00 00 00    00 00 00 00    00 00 00 00     ........ ........<br>    00 00 00 00    00 00 00 00    00 00 00 00    00 00 00 00     ........ ........<br>    00 00 00 00    00 00 00 00    00 00 00 00    00 00 00 00     ........ ........<br>    00 00 00 00    00 00 00 00    00 00 00 00    00 00 00 00     ........ ........<br>    00 00 00 00    00 00 00 00    00 00 00 00    00 00 00 00     ........ ........<br>    00 00 00 00    00 00 00 00    00 00 00 00    00 00 00 00     ........ ........<br>    00 00 00 00    00 00 00 00    00 00 00 00    00 00 00 00     ........ ........<br>    00 00 00 00    00 00 00 00    00 00 00 00    00 00 00 00     ........ ........<br>    00 00 00 00    00 00 00 00    00 00 00 00    00 00 00 00     ........ ........<br>    00 00 00 00    00 00 00 00    00 00 00 00    00 00 00 00     ........ ........<br><br><br>---------- Block 29 at 0x08D52C50: 23168 bytes ----------<br>  Call Stack:<br>    f:\vs70builds\3077\vc\crtbld\crt\src\newop.cpp (12): MyBullet.dll!operator new + 0x9 bytes<br>    c:\developer\support\bullet-2.78\src\bulletmultithreaded\spunarrowphasecollisiontask\spugatheringcollisiontask.cpp (196): MyBullet.dll!createCollisionLocalStoreMemory + 0xA bytes<br>    c:\developer\support\bullet-2.78\src\bulletmultithreaded\win32threadsupport.cpp (268): MyBullet.dll!Win32ThreadSupport::startThreads + 0x8 bytes<br>    c:\developer\support\bullet-2.78\src\bulletmultithreaded\win32threadsupport.cpp (37): MyBullet.dll!Win32ThreadSupport::Win32ThreadSupport<br><br>  Data:<br>    00 00 00 00    00 00 00 00    00 00 00 00    00 00 00 00     ........ ........<br>    00 00 00 00    00 00 00 00    00 00 00 00    00 00 00 00     ........ ........<br>    00 00 00 00    00 00 00 00    00 00 00 00    00 00 00 00     ........ ........<br>    00 00 00 00    00 00 00 00    00 00 00 00    00 00 00 00     ........ ........<br>    00 00 00 00    00 00 00 00    00 00 00 00    00 00 00 00     ........ ........<br>    00 00 00 00    00 00 00 00    00 00 00 00    00 00 00 00     ........ ........<br>    00 00 00 00    00 00 00 00    00 00 00 00    00 00 00 00     ........ ........<br>    00 00 00 00    00 00 00 00    00 00 00 00    00 00 00 00     ........ ........<br>    00 00 00 00    00 00 00 00    00 00 00 00    00 00 00 00     ........ ........<br>    00 00 00 00    00 00 00 00    00 00 00 00    00 00 00 00     ........ ........<br>    00 00 00 00    00 00 00 00    00 00 00 00    00 00 00 00     ........ ........<br>    00 00 00 00    00 00 00 00    00 00 00 00    00 00 00 00     ........ ........<br>    00 00 00 00    00 00 00 00    00 00 00 00    00 00 00 00     ........ ........<br>    00 00 00 00    00 00 00 00    00 00 00 00    00 00 00 00     ........ ........<br>    00 00 00 00    00 00 00 00    00 00 00 00    00 00 00 00     ........ ........<br>    00 00 00 00    00 00 00 00    00 00 00 00    00 00 00 00     ........ ........<br><br><br>Visual Leak Detector detected 4 memory leaks.<br>Visual Leak Detector is now exiting.<br>Detected memory leaks!<br>Dumping objects -&gt;<br>{7019} normal block at 0x08CE12A8, 195 bytes long.<br> Data: &lt;                &gt; CD CD CD CD A8 12 CE 08 D8 BF C9 03 CD CD CD CD <br>{7018} normal block at 0x01F7EAB8, 91 bytes long.<br> Data: &lt;            X , &gt; CD CD CD CD B8 EA F7 01 B0 BF C9 03 58 C7 2C 00 <br>{7008} normal block at 0x08D52C50, 23168 bytes long.<br> Data: &lt;                &gt; 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 <br>{7007} normal block at 0x08D4D190, 23168 bytes long.<br> Data: &lt;                &gt; 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 <br>Object dump complete.<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=5767">nsdavidlj</a> — Wed Jul 06, 2011 2:53 am</p><hr />
]]></content>
	</entry>
	</feed>
