<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Finding Memory Errors in Java JNI DLL in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/Finding-Memory-Errors-in-Java-JNI-DLL/m-p/747431#M2559</link>
    <description>&lt;DIV id="tiny_quote"&gt;&lt;DIV style="margin-left: 2px; margin-right: 2px;"&gt;Quoting &lt;A jquery1337773943734="59" rel="/en-us/services/profile/quick_profile.php?is_paid=&amp;amp;user_id=353541" href="https://community.intel.com/en-us/profile/353541/" class="basic"&gt;Sergey Kostrov&lt;/A&gt;&lt;/DIV&gt;&lt;DIV style="background-color: #e5e5e5; margin-left: 2px; margin-right: 2px; border: 1px inset; padding: 5px;"&gt;&lt;I&gt;&lt;DIV id="tiny_quote"&gt;&lt;DIV style="margin-left: 2px; margin-right: 2px;"&gt;Quoting &lt;A jquery1337773943734="60" jquery1337732816875="58" rel="/en-us/services/profile/quick_profile.php?is_paid=&amp;amp;user_id=563707" href="https://community.intel.com/en-us/profile/563707/" class="basic"&gt;David Eisner&lt;/A&gt;&lt;/DIV&gt;&lt;DIV style="background-color: #e5e5e5; margin-left: 2px; margin-right: 2px; border: 1px inset; padding: 5px;"&gt;&lt;I&gt;...it's 3rd-party but with the source code...&lt;/I&gt;&lt;/DIV&gt;&lt;BR /&gt;As a compromiseyou coulduse &lt;STRONG&gt;MFC&lt;/STRONG&gt;-based &lt;STRONG&gt;Memory Leaks&lt;/STRONG&gt; detection with a report to an external txt-file...&lt;/DIV&gt;&lt;BR /&gt;&lt;/I&gt;&lt;/DIV&gt;&lt;BR /&gt;The following piece of code could be used to enable MFC-based Memory Leaks detection:&lt;BR /&gt;&lt;BR /&gt;[cpp]	...
	RTtchar *g_pszMemLeaksReportLog = RTU("C:\MemLeaksReport.log");
	...
	RThandle hLogFile = RTnull;

	_CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
	_CrtSetReportMode( _CRT_WARN, _CRTDBG_MODE_DEBUG );

	hLogFile = ::CreateFile( g_pszMemLeaksReportLog,
				  GENERIC_WRITE, FILE_SHARE_WRITE, RTnull, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, RTnull );
	if( hLogFile == RTnull )
		return;

	_CrtSetReportMode( _CRT_WARN, _CRTDBG_MODE_FILE );
	_CrtSetReportFile( _CRT_WARN, hLogFile );

	_RPT0( _CRT_WARN, "Processing startedn" );
	...
[/cpp]&lt;BR /&gt;It is configured tocreate areport( external file )and here is example of how it looks like:&lt;BR /&gt;&lt;BR /&gt; ...&lt;BR /&gt; Processing started&lt;BR /&gt; virtual CTest::~CTest()&lt;BR /&gt; virtual CTest::~CTest()&lt;BR /&gt; virtual CTest::~CTest()&lt;BR /&gt; virtual CTest::~CTest()&lt;BR /&gt; virtual CTest::~CTest()&lt;BR /&gt; virtual CTest::~CTest()&lt;BR /&gt; virtual CTest::~CTest()&lt;BR /&gt; virtual CTest::~CTest()&lt;BR /&gt; Detected memory leaks!&lt;BR /&gt; Dumping objects -&amp;gt;&lt;BR /&gt; ..\common\&lt;SPAN style="text-decoration: underline;"&gt;prttests.cpp(5943)&lt;/SPAN&gt; : {91} normal block at 0x041B0040, 4194304 bytes long.&lt;BR /&gt; Data: &amp;lt; &amp;gt; CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD &lt;BR /&gt; ..\common\&lt;SPAN style="text-decoration: underline;"&gt;prttests.cpp(5943)&lt;/SPAN&gt; : {89} normal block at 0x03DA0040, 4194304 bytes long.&lt;BR /&gt; Data: &amp;lt; &amp;gt; CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD &lt;BR /&gt; ..\common\&lt;SPAN style="text-decoration: underline;"&gt;prttests.cpp(5943)&lt;/SPAN&gt; : {87} normal block at 0x03990040, 4194304 bytes long.&lt;BR /&gt; Data: &amp;lt; &amp;gt; CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD &lt;BR /&gt; ..\common\&lt;SPAN style="text-decoration: underline;"&gt;prttests.cpp(5943)&lt;/SPAN&gt; : {85} normal block at 0x03580040, 4194304 bytes long.&lt;BR /&gt; Data: &amp;lt; &amp;gt; CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD &lt;BR /&gt; ..\common\&lt;SPAN style="text-decoration: underline;"&gt;prttests.cpp(5943)&lt;/SPAN&gt; : {83} normal block at 0x03170040, 4194304 bytes long.&lt;BR /&gt; Data: &amp;lt; &amp;gt; CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD &lt;BR /&gt; ..\common\&lt;SPAN style="text-decoration: underline;"&gt;prttests.cpp(5943)&lt;/SPAN&gt; : {81} normal block at 0x02D60040, 4194304 bytes long.&lt;BR /&gt; Data: &amp;lt; &amp;gt; CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD &lt;BR /&gt; ..\common\&lt;SPAN style="text-decoration: underline;"&gt;prttests.cpp(5943)&lt;/SPAN&gt; : {79} normal block at 0x02950040, 4194304 bytes long.&lt;BR /&gt; Data: &amp;lt; &amp;gt; CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD &lt;BR /&gt; ..\common\&lt;SPAN style="text-decoration: underline;"&gt;prttests.cpp(5943)&lt;/SPAN&gt; : {77} normal block at 0x02140040, 4194304 bytes long.&lt;BR /&gt; Data: &amp;lt; &amp;gt; CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD &lt;BR /&gt; Object dump complete.&lt;BR /&gt; Processing Completed&lt;BR /&gt; ...&lt;/DIV&gt;</description>
    <pubDate>Wed, 23 May 2012 12:03:55 GMT</pubDate>
    <dc:creator>SergeyKostrov</dc:creator>
    <dc:date>2012-05-23T12:03:55Z</dc:date>
    <item>
      <title>Finding Memory Errors in Java JNI DLL</title>
      <link>https://community.intel.com/t5/Software-Archive/Finding-Memory-Errors-in-Java-JNI-DLL/m-p/747421#M2549</link>
      <description>&lt;P&gt;I'm evaluating Intel Parallel Inspector 2011 (PIN) with Visual Studio (VS) 2008. I'm trying to find memory errors in a DLL that provides native JNI methods to a Java application (JDK 6), but I'm having some difficulty. &lt;/P&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;My understanding is that in order to analyze a DLL using PIN, it's necessary to specify a target .exe that loads the DLL. So I wrote a simple Java console app that exercises the DLL and packaged it into a JAR file that can be executed with "java.exe -jar MyTestApp.jar". I have my DLL in the same directory as the java.exe I'm using.&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the VS debug configuration I have 'C:\\path_to\\java.exe' set for the command and '-jar C:\\path_to\\MyTestApp.jar' for the arguments. I start the PIN inspector analysis, the java app runs to completion, and I get a report about Memory Errors. However, my DLL is not listed, only these:&lt;/P&gt;
&lt;P&gt; java.dll, java.exe, jvm.dll, msvcr71.dll, ntdll.dll, and zip.dll&lt;/P&gt;
&lt;P&gt;I added an intentional bug to my DLL (reading an uninitialized automatic variable), but the bug isn't discovered. I thought perhaps the C compiler's basic runtime checks might be hiding the error (it discovered the bug and brought up a warning dialog at runtime), so I dialed the runtime checks down to 'Default'. It no longer warns me about my intentional bug, but PIN still does not detect it.&lt;/P&gt;
&lt;P&gt;What am I doing wrong? Thanks!&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 15 May 2012 22:55:54 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Finding-Memory-Errors-in-Java-JNI-DLL/m-p/747421#M2549</guid>
      <dc:creator>David_Eisner</dc:creator>
      <dc:date>2012-05-15T22:55:54Z</dc:date>
    </item>
    <item>
      <title>Finding Memory Errors in Java JNI DLL</title>
      <link>https://community.intel.com/t5/Software-Archive/Finding-Memory-Errors-in-Java-JNI-DLL/m-p/747422#M2550</link>
      <description>David,&lt;BR /&gt;&lt;BR /&gt;Intel Parallel Inspector doesn't support analyzing of child processes. You can only analyze the target process. Moreover, Java is not supported. &lt;BR /&gt;Intel Inspector XE is a more featured variant. It can analyze child processes. However Java is not supported as well. You may try it, but there is no any garantee that the tool will be able to locate your dll.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Kirill</description>
      <pubDate>Thu, 17 May 2012 10:33:20 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Finding-Memory-Errors-in-Java-JNI-DLL/m-p/747422#M2550</guid>
      <dc:creator>Kirill_R_Intel</dc:creator>
      <dc:date>2012-05-17T10:33:20Z</dc:date>
    </item>
    <item>
      <title>Finding Memory Errors in Java JNI DLL</title>
      <link>https://community.intel.com/t5/Software-Archive/Finding-Memory-Errors-in-Java-JNI-DLL/m-p/747423#M2551</link>
      <description>&lt;P&gt;Kirill,&lt;/P&gt;

&lt;P&gt;Thanks for the response. Java JNI code does not run inside a child process -- it runs in the same process as the java.exe executable. And it is not Java bytecode. Rather, it's native code, written in C/C++ (or assembly) which is compiled into a standard PE32 DLL (using e.g. Visual Studio's C compiler). This DLL is loaded at runtime by the native java.exe process.&lt;/P&gt;

&lt;P&gt;Or to put it another way, java.exe is just a native C program using LoadLibrary() to load my DLL when the java bytecode it's interpreting tells it to do so.&lt;/P&gt;

&lt;P&gt;-David&lt;/P&gt;</description>
      <pubDate>Thu, 17 May 2012 21:23:32 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Finding-Memory-Errors-in-Java-JNI-DLL/m-p/747423#M2551</guid>
      <dc:creator>David_Eisner</dc:creator>
      <dc:date>2012-05-17T21:23:32Z</dc:date>
    </item>
    <item>
      <title>Finding Memory Errors in Java JNI DLL</title>
      <link>https://community.intel.com/t5/Software-Archive/Finding-Memory-Errors-in-Java-JNI-DLL/m-p/747424#M2552</link>
      <description>&lt;DIV id="tiny_quote"&gt;&lt;DIV style="margin-left: 2px; margin-right: 2px;"&gt;Quoting &lt;A jquery1337343400593="58" rel="/en-us/services/profile/quick_profile.php?is_paid=&amp;amp;user_id=563707" href="https://community.intel.com/en-us/profile/563707/" class="basic"&gt;David Eisner&lt;/A&gt;&lt;/DIV&gt;&lt;DIV style="background-color: #e5e5e5; margin-left: 2px; margin-right: 2px; border: 1px inset; padding: 5px;"&gt;&lt;I&gt;...Rather, it's native code, written in C/C++ (or assembly) which is compiled into a standard PE32 DLL (using e.g. Visual Studio's C compiler).&lt;/I&gt;&lt;/DIV&gt;&lt;BR /&gt;Do you have thesource codes for the DLL?&lt;BR /&gt;&lt;BR /&gt;I simply would like to understand if this is your own DLL, orfrom some 3rd-partywithout the source codes.&lt;BR /&gt;&lt;BR /&gt;Best regards,&lt;BR /&gt;Sergey&lt;/DIV&gt;</description>
      <pubDate>Fri, 18 May 2012 12:17:28 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Finding-Memory-Errors-in-Java-JNI-DLL/m-p/747424#M2552</guid>
      <dc:creator>SergeyKostrov</dc:creator>
      <dc:date>2012-05-18T12:17:28Z</dc:date>
    </item>
    <item>
      <title>Finding Memory Errors in Java JNI DLL</title>
      <link>https://community.intel.com/t5/Software-Archive/Finding-Memory-Errors-in-Java-JNI-DLL/m-p/747425#M2553</link>
      <description>Yes, Java loads dll in it's process, but it's not supported, there possible some drawbacks. Can you attach your test reproducer to the thread, so I we can play with it and look what's wrong?</description>
      <pubDate>Fri, 18 May 2012 15:21:55 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Finding-Memory-Errors-in-Java-JNI-DLL/m-p/747425#M2553</guid>
      <dc:creator>Kirill_R_Intel</dc:creator>
      <dc:date>2012-05-18T15:21:55Z</dc:date>
    </item>
    <item>
      <title>Finding Memory Errors in Java JNI DLL</title>
      <link>https://community.intel.com/t5/Software-Archive/Finding-Memory-Errors-in-Java-JNI-DLL/m-p/747426#M2554</link>
      <description>&lt;DIV id="tiny_quote"&gt;&lt;DIV style="margin-left: 2px; margin-right: 2px;"&gt;Hi everybody,&lt;BR /&gt;&lt;BR /&gt;I'd like to make a little correction:&lt;BR /&gt;&lt;BR /&gt;Quoting &lt;A jquery1337389020718="58" rel="/en-us/services/profile/quick_profile.php?is_paid=&amp;amp;user_id=506434" href="https://community.intel.com/en-us/profile/506434/" class="basic"&gt;Kirill Rogozhin (Intel)&lt;/A&gt;&lt;/DIV&gt;&lt;DIV style="background-color: #e5e5e5; margin-left: 2px; margin-right: 2px; border: 1px inset; padding: 5px;"&gt;&lt;I&gt;...Java loads dll in it's process...&lt;/I&gt;&lt;/DIV&gt;&lt;BR /&gt;...Java loadsdll in its &lt;SPAN style="text-decoration: underline;"&gt;address space&lt;/SPAN&gt;...&lt;BR /&gt;&lt;BR /&gt;Best regards,&lt;BR /&gt;Sergey&lt;/DIV&gt;</description>
      <pubDate>Sat, 19 May 2012 00:59:13 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Finding-Memory-Errors-in-Java-JNI-DLL/m-p/747426#M2554</guid>
      <dc:creator>SergeyKostrov</dc:creator>
      <dc:date>2012-05-19T00:59:13Z</dc:date>
    </item>
    <item>
      <title>Finding Memory Errors in Java JNI DLL</title>
      <link>https://community.intel.com/t5/Software-Archive/Finding-Memory-Errors-in-Java-JNI-DLL/m-p/747427#M2555</link>
      <description>&lt;P&gt;Sergey,&lt;/P&gt;&lt;P&gt;Neither -- it's 3rd-party but with the source code. It's the RXTX library an open source Java library for serial and parallel port communication:&lt;A href="http://rxtx.qbang.org/wiki/index.php/FAQ"&gt;http://rxtx.qbang.org/wiki/index.php/FAQ&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;-David&lt;/P&gt;</description>
      <pubDate>Tue, 22 May 2012 14:27:33 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Finding-Memory-Errors-in-Java-JNI-DLL/m-p/747427#M2555</guid>
      <dc:creator>David_Eisner</dc:creator>
      <dc:date>2012-05-22T14:27:33Z</dc:date>
    </item>
    <item>
      <title>Finding Memory Errors in Java JNI DLL</title>
      <link>https://community.intel.com/t5/Software-Archive/Finding-Memory-Errors-in-Java-JNI-DLL/m-p/747428#M2556</link>
      <description>&lt;P&gt;Kirill,&lt;/P&gt;
&lt;P&gt;Thanks for taking the time to look at this.  I'll try to post something soon, either today or tomorrow.&lt;/P&gt;
&lt;P&gt;-David&lt;/P&gt;</description>
      <pubDate>Tue, 22 May 2012 14:28:39 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Finding-Memory-Errors-in-Java-JNI-DLL/m-p/747428#M2556</guid>
      <dc:creator>David_Eisner</dc:creator>
      <dc:date>2012-05-22T14:28:39Z</dc:date>
    </item>
    <item>
      <title>Finding Memory Errors in Java JNI DLL</title>
      <link>https://community.intel.com/t5/Software-Archive/Finding-Memory-Errors-in-Java-JNI-DLL/m-p/747429#M2557</link>
      <description>&lt;P&gt;I've attached a zip file containing a Visual Studio 2008 project for the DLL code, and a Netbeans project for the Java class, CommTest.java, which uses the RXTXcomm.jar library (which itself uses the JNI rxtxSerial.dll).  As I mentioned, the PIN configuration runs 'java.exe -jar C:\path_to\CommTest.jar'. I've also included a Netbeans project for the RXTXcomm.jar library, but you don't really need that.  The CommTest.jar in PIN Example/Netbeans/CommTest/dist/ is setup to load the already-compiled RXTXcomm.jar from the lib/ subdirectory.&lt;/P&gt;

&lt;P&gt;In the DLL code, I've introduced an intentional bug in termios.c, at the beginning of serial_test() that does an uninitialized variable read, something I assume PIN should catch.&lt;/P&gt;

&lt;P&gt;If this is too complicated, let me know and I can try to generate a simpler JAR/DLL that illustrates the problem.&lt;/P&gt;

&lt;P&gt;Thanks again.&lt;/P&gt;</description>
      <pubDate>Tue, 22 May 2012 17:13:32 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Finding-Memory-Errors-in-Java-JNI-DLL/m-p/747429#M2557</guid>
      <dc:creator>David_Eisner</dc:creator>
      <dc:date>2012-05-22T17:13:32Z</dc:date>
    </item>
    <item>
      <title>Finding Memory Errors in Java JNI DLL</title>
      <link>https://community.intel.com/t5/Software-Archive/Finding-Memory-Errors-in-Java-JNI-DLL/m-p/747430#M2558</link>
      <description>&lt;DIV id="tiny_quote"&gt;&lt;DIV style="margin-left: 2px; margin-right: 2px;"&gt;Quoting &lt;A jquery1337732816875="58" rel="/en-us/services/profile/quick_profile.php?is_paid=&amp;amp;user_id=563707" href="https://community.intel.com/en-us/profile/563707/" class="basic"&gt;David Eisner&lt;/A&gt;&lt;/DIV&gt;&lt;DIV style="background-color: #e5e5e5; margin-left: 2px; margin-right: 2px; border: 1px inset; padding: 5px;"&gt;&lt;I&gt;...it's 3rd-party but with the source code...&lt;/I&gt;&lt;/DIV&gt;&lt;BR /&gt;As a compromiseyou coulduse &lt;STRONG&gt;MFC&lt;/STRONG&gt;-based &lt;STRONG&gt;Memory Leaks&lt;/STRONG&gt; detection with a report to an external txt-file.&lt;BR /&gt;&lt;BR /&gt;I'll prepare a Test-Case on how to do it. Would it help?&lt;BR /&gt;&lt;BR /&gt;Best regards,&lt;BR /&gt;Sergey&lt;/DIV&gt;</description>
      <pubDate>Wed, 23 May 2012 00:29:48 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Finding-Memory-Errors-in-Java-JNI-DLL/m-p/747430#M2558</guid>
      <dc:creator>SergeyKostrov</dc:creator>
      <dc:date>2012-05-23T00:29:48Z</dc:date>
    </item>
    <item>
      <title>Finding Memory Errors in Java JNI DLL</title>
      <link>https://community.intel.com/t5/Software-Archive/Finding-Memory-Errors-in-Java-JNI-DLL/m-p/747431#M2559</link>
      <description>&lt;DIV id="tiny_quote"&gt;&lt;DIV style="margin-left: 2px; margin-right: 2px;"&gt;Quoting &lt;A jquery1337773943734="59" rel="/en-us/services/profile/quick_profile.php?is_paid=&amp;amp;user_id=353541" href="https://community.intel.com/en-us/profile/353541/" class="basic"&gt;Sergey Kostrov&lt;/A&gt;&lt;/DIV&gt;&lt;DIV style="background-color: #e5e5e5; margin-left: 2px; margin-right: 2px; border: 1px inset; padding: 5px;"&gt;&lt;I&gt;&lt;DIV id="tiny_quote"&gt;&lt;DIV style="margin-left: 2px; margin-right: 2px;"&gt;Quoting &lt;A jquery1337773943734="60" jquery1337732816875="58" rel="/en-us/services/profile/quick_profile.php?is_paid=&amp;amp;user_id=563707" href="https://community.intel.com/en-us/profile/563707/" class="basic"&gt;David Eisner&lt;/A&gt;&lt;/DIV&gt;&lt;DIV style="background-color: #e5e5e5; margin-left: 2px; margin-right: 2px; border: 1px inset; padding: 5px;"&gt;&lt;I&gt;...it's 3rd-party but with the source code...&lt;/I&gt;&lt;/DIV&gt;&lt;BR /&gt;As a compromiseyou coulduse &lt;STRONG&gt;MFC&lt;/STRONG&gt;-based &lt;STRONG&gt;Memory Leaks&lt;/STRONG&gt; detection with a report to an external txt-file...&lt;/DIV&gt;&lt;BR /&gt;&lt;/I&gt;&lt;/DIV&gt;&lt;BR /&gt;The following piece of code could be used to enable MFC-based Memory Leaks detection:&lt;BR /&gt;&lt;BR /&gt;[cpp]	...
	RTtchar *g_pszMemLeaksReportLog = RTU("C:\MemLeaksReport.log");
	...
	RThandle hLogFile = RTnull;

	_CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
	_CrtSetReportMode( _CRT_WARN, _CRTDBG_MODE_DEBUG );

	hLogFile = ::CreateFile( g_pszMemLeaksReportLog,
				  GENERIC_WRITE, FILE_SHARE_WRITE, RTnull, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, RTnull );
	if( hLogFile == RTnull )
		return;

	_CrtSetReportMode( _CRT_WARN, _CRTDBG_MODE_FILE );
	_CrtSetReportFile( _CRT_WARN, hLogFile );

	_RPT0( _CRT_WARN, "Processing startedn" );
	...
[/cpp]&lt;BR /&gt;It is configured tocreate areport( external file )and here is example of how it looks like:&lt;BR /&gt;&lt;BR /&gt; ...&lt;BR /&gt; Processing started&lt;BR /&gt; virtual CTest::~CTest()&lt;BR /&gt; virtual CTest::~CTest()&lt;BR /&gt; virtual CTest::~CTest()&lt;BR /&gt; virtual CTest::~CTest()&lt;BR /&gt; virtual CTest::~CTest()&lt;BR /&gt; virtual CTest::~CTest()&lt;BR /&gt; virtual CTest::~CTest()&lt;BR /&gt; virtual CTest::~CTest()&lt;BR /&gt; Detected memory leaks!&lt;BR /&gt; Dumping objects -&amp;gt;&lt;BR /&gt; ..\common\&lt;SPAN style="text-decoration: underline;"&gt;prttests.cpp(5943)&lt;/SPAN&gt; : {91} normal block at 0x041B0040, 4194304 bytes long.&lt;BR /&gt; Data: &amp;lt; &amp;gt; CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD &lt;BR /&gt; ..\common\&lt;SPAN style="text-decoration: underline;"&gt;prttests.cpp(5943)&lt;/SPAN&gt; : {89} normal block at 0x03DA0040, 4194304 bytes long.&lt;BR /&gt; Data: &amp;lt; &amp;gt; CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD &lt;BR /&gt; ..\common\&lt;SPAN style="text-decoration: underline;"&gt;prttests.cpp(5943)&lt;/SPAN&gt; : {87} normal block at 0x03990040, 4194304 bytes long.&lt;BR /&gt; Data: &amp;lt; &amp;gt; CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD &lt;BR /&gt; ..\common\&lt;SPAN style="text-decoration: underline;"&gt;prttests.cpp(5943)&lt;/SPAN&gt; : {85} normal block at 0x03580040, 4194304 bytes long.&lt;BR /&gt; Data: &amp;lt; &amp;gt; CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD &lt;BR /&gt; ..\common\&lt;SPAN style="text-decoration: underline;"&gt;prttests.cpp(5943)&lt;/SPAN&gt; : {83} normal block at 0x03170040, 4194304 bytes long.&lt;BR /&gt; Data: &amp;lt; &amp;gt; CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD &lt;BR /&gt; ..\common\&lt;SPAN style="text-decoration: underline;"&gt;prttests.cpp(5943)&lt;/SPAN&gt; : {81} normal block at 0x02D60040, 4194304 bytes long.&lt;BR /&gt; Data: &amp;lt; &amp;gt; CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD &lt;BR /&gt; ..\common\&lt;SPAN style="text-decoration: underline;"&gt;prttests.cpp(5943)&lt;/SPAN&gt; : {79} normal block at 0x02950040, 4194304 bytes long.&lt;BR /&gt; Data: &amp;lt; &amp;gt; CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD &lt;BR /&gt; ..\common\&lt;SPAN style="text-decoration: underline;"&gt;prttests.cpp(5943)&lt;/SPAN&gt; : {77} normal block at 0x02140040, 4194304 bytes long.&lt;BR /&gt; Data: &amp;lt; &amp;gt; CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD &lt;BR /&gt; Object dump complete.&lt;BR /&gt; Processing Completed&lt;BR /&gt; ...&lt;/DIV&gt;</description>
      <pubDate>Wed, 23 May 2012 12:03:55 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Finding-Memory-Errors-in-Java-JNI-DLL/m-p/747431#M2559</guid>
      <dc:creator>SergeyKostrov</dc:creator>
      <dc:date>2012-05-23T12:03:55Z</dc:date>
    </item>
    <item>
      <title>Finding Memory Errors in Java JNI DLL</title>
      <link>https://community.intel.com/t5/Software-Archive/Finding-Memory-Errors-in-Java-JNI-DLL/m-p/747432#M2560</link>
      <description>Here is updated set of codes you could use:&lt;BR /&gt;&lt;BR /&gt;[cpp]	// Header files
	...
	#define CRTDBG_MAP_ALLOC
	#include &lt;MALLOC.H&gt;
	#include &lt;CRTDBG.H&gt;
	...

	// Initialization
	...
	TCHAR *g_pszMemLeaksReportLog = _T("C:\MemLeaksReport.log");
	...
	HANDLE hLogFile = NULL;

	_CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
	_CrtSetReportMode( _CRT_WARN, _CRTDBG_MODE_DEBUG );

	hLogFile = ::CreateFile( g_pszMemLeaksReportLog,
				  GENERIC_WRITE, FILE_SHARE_WRITE, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL );
	if( hLogFile == NULL )
		return;

	_CrtSetReportMode( _CRT_WARN, _CRTDBG_MODE_FILE );
	_CrtSetReportFile( _CRT_WARN, hLogFile );

	_RPT0( _CRT_WARN, "Processing startedn" );
	...

	// Your processing...

	// Final cleanups
	...
	_CrtDumpMemoryLeaks();
	_RPT0( _CRT_WARN, "Processing Completedn" );

	if( hLogFile != NULL )
	{
		::CloseHandle( hLogFile );
		hLogFile = NULL;
	}
	...[/cpp]&lt;BR /&gt;&lt;P&gt;These libraries should be used ( Debug versions )&lt;/P&gt;&lt;P&gt; &lt;STRONG&gt;msvcrtd.lib&lt;/STRONG&gt;&lt;BR /&gt; &lt;STRONG&gt;msvcurtd.lib&lt;/STRONG&gt; if Unicode Character Set is used&lt;/P&gt;&lt;/CRTDBG.H&gt;&lt;/MALLOC.H&gt;</description>
      <pubDate>Fri, 25 May 2012 12:57:52 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Finding-Memory-Errors-in-Java-JNI-DLL/m-p/747432#M2560</guid>
      <dc:creator>SergeyKostrov</dc:creator>
      <dc:date>2012-05-25T12:57:52Z</dc:date>
    </item>
  </channel>
</rss>

