<?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 My test program in post 10 in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Memory-leak/m-p/916542#M84331</link>
    <description>&lt;P&gt;My test program in post 10 still shows a leak here with 14.0.2.&lt;/P&gt;</description>
    <pubDate>Tue, 18 Feb 2014 20:26:07 GMT</pubDate>
    <dc:creator>IanH</dc:creator>
    <dc:date>2014-02-18T20:26:07Z</dc:date>
    <item>
      <title>Memory leak</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Memory-leak/m-p/916522#M84311</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;I have a memory leak. See attached example, which is an adapted portion of a much larger code.&lt;/P&gt;

&lt;P&gt;This code (and&amp;nbsp;the rest of the application) was doing everything with&amp;nbsp;pointers.&amp;nbsp;Over the past few months I have been replacing them all with allocatables, on the assumption that memory leaks are not possible with allocatables. ...Well clearly I was mistaken&amp;nbsp;on that, so what am I doing wrong?&lt;/P&gt;

&lt;P&gt;The leak occurs in&amp;nbsp;copy_branch_plot_results, when it calls construct_branch_plot_results. In its original form with pointers, the code was a lot busier, with explicit&amp;nbsp;tests all over to de-allocate the pointers where necessarry. I assumed this was not required with allocatables, so removed most of it, and was dismayed to find that my changes introduced leaks.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Qolin&lt;/P&gt;</description>
      <pubDate>Wed, 20 Nov 2013 16:34:48 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Memory-leak/m-p/916522#M84311</guid>
      <dc:creator>qolin</dc:creator>
      <dc:date>2013-11-20T16:34:48Z</dc:date>
    </item>
    <item>
      <title> </title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Memory-leak/m-p/916523#M84312</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Sorry I should have specified the compiler version:&lt;/P&gt;

&lt;P&gt;Intel(R) Inspector XE 2013 (build 250094)&lt;BR /&gt;
	Intel(R) Parallel Studio XE 2013&lt;BR /&gt;
	Copyright (C) 1985-2013 Intel Corporation. All rights reserved.&lt;BR /&gt;
	Intel(R) Composer XE 2013 Update 5 (package 198)&lt;/P&gt;

&lt;P&gt;&lt;BR /&gt;
	C:\Program Files (x86)\Intel\Composer XE 2013&amp;gt;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Nov 2013 18:42:46 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Memory-leak/m-p/916523#M84312</guid>
      <dc:creator>qolin</dc:creator>
      <dc:date>2013-11-20T18:42:46Z</dc:date>
    </item>
    <item>
      <title>It is not clear what you mean</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Memory-leak/m-p/916524#M84313</link>
      <description>&lt;P&gt;It is not clear what you mean by "memory leak".&lt;/P&gt;

&lt;P&gt;A local variable (scalar or array) with the ALLOCATABLE attribute and whose status is "allocated" stays allocated unless it is used in a DEALLOCATE statement or the subprogram to which it belongs as a local variable executes a RETURN statement.&lt;/P&gt;

&lt;P&gt;If you allocate a large array in&amp;nbsp;the main program and never deallocate it, that array occupies a chunk of memory until your program terminates. This is not what should be called a memory leak. If you wish to release memory earlier, you can write DEALLOCATE statement at appropriate places.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Nov 2013 20:40:49 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Memory-leak/m-p/916524#M84313</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2013-11-20T20:40:49Z</dc:date>
    </item>
    <item>
      <title>How are you detecting the</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Memory-leak/m-p/916525#M84314</link>
      <description>&lt;P&gt;How are you detecting the "leak"?&lt;/P&gt;</description>
      <pubDate>Wed, 20 Nov 2013 21:48:51 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Memory-leak/m-p/916525#M84314</guid>
      <dc:creator>IanH</dc:creator>
      <dc:date>2013-11-20T21:48:51Z</dc:date>
    </item>
    <item>
      <title>Task manager and debugger. </title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Memory-leak/m-p/916526#M84315</link>
      <description>&lt;P&gt;Task manager and debugger.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Breakpoint at the start of the loop and on the continue statement, this allows you to note memory used at start and end. For good measure you can breakpoint inside the loop to see the memory usage increase every time round. On Win7 processees tab, the column of interest is "Commit size".&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Try the code as posted, and compare the behaviour with the alternative form of the code in copy_branch_plot_results.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Qolin&lt;/P&gt;</description>
      <pubDate>Wed, 20 Nov 2013 22:14:56 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Memory-leak/m-p/916526#M84315</guid>
      <dc:creator>qolin</dc:creator>
      <dc:date>2013-11-20T22:14:56Z</dc:date>
    </item>
    <item>
      <title>I don't think that's</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Memory-leak/m-p/916527#M84316</link>
      <description>&lt;P&gt;I don't think that's confirmation of a leak (if you have a leak you will see that behaviour, but seeing that behaviour doesn't necessarily mean that you have a leak) - for example you could see progressively increasing commit in the face of memory fragmentation or perhaps some design decisions around the runtime allocator behaviour.&lt;/P&gt;

&lt;P&gt;I have a little module somewhere that lets Fortran programs query the underlying C runtime allocator for debug builds or the underlying opreating system allocator.&amp;nbsp; I've used that to find leaks before.&amp;nbsp; If time permits later today I'll see if I can find them and "instrument" your code.&lt;/P&gt;

&lt;P&gt;You can use tools such as vmmap.exe from sys internals to look at the operating system's idea of memory allocation for your process.&amp;nbsp; That doesn't necessarily tell you what the C or Fortran runtime thinks is going on though (but those runtimes don't do much thinking, if memory serves me correctly).&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Nov 2013 22:28:25 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Memory-leak/m-p/916527#M84316</guid>
      <dc:creator>IanH</dc:creator>
      <dc:date>2013-11-20T22:28:25Z</dc:date>
    </item>
    <item>
      <title>OK what I haven't explained</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Memory-leak/m-p/916528#M84317</link>
      <description>&lt;P&gt;OK what I haven't explained is how I found this.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;On the actual, much larger, code, we were clearly seeing memory leaks, as evidenced by&amp;nbsp;task manager. The Commit size was staring off around 250 MB, and after some hours had risen through 8 GB.&amp;nbsp;We knew that the problem had been introduced recently, like in the last 6 weeks or so.&amp;nbsp;Our code is rebuilt every night and the resulting builds&amp;nbsp;copied to a server for possible historical reference. So I ran the problem dataset on various overnight builds, and was able to pin down the particular build which first exhibited the leak, and thence from the source control history, the&amp;nbsp;changeset that introduced it. As I said earlier, I have been swapping pointers to allocatables, and it was one of my changes. But I couldn't understand how that change could produce a leak.&lt;/P&gt;

&lt;P&gt;Luckily we&amp;nbsp;have access to (drum roll)&amp;nbsp;&lt;STRONG&gt;Intel Inspector&lt;/STRONG&gt;, and pointing it at the code produced a clear report, pointing to the allocate in construct_branch_plot_results_appv. Of course Inspector doesn't tell you the line of code responsible for loosing the memory that constitutes the leak;&amp;nbsp;it only tells you which line allocated it originally, and you have to work out how it gets lost.&lt;/P&gt;

&lt;P&gt;So after about 10 minutes detective work and experimental code modification, I found that changing &amp;nbsp;to the alternative form in&amp;nbsp;&lt;SPAN style="font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px;"&gt;copy_branch_plot_results makes it work correctly. Task manager no longer showed memory increasing, and inspector gave it a clean bill of health.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Nov 2013 22:52:16 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Memory-leak/m-p/916528#M84317</guid>
      <dc:creator>qolin</dc:creator>
      <dc:date>2013-11-20T22:52:16Z</dc:date>
    </item>
    <item>
      <title>Ok.  I found my routines,</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Memory-leak/m-p/916529#M84318</link>
      <description>&lt;P&gt;Ok.&amp;nbsp; I found my routines, which show a "leak".&amp;nbsp; But it is a programming error - not a compiler problem.&amp;nbsp; There are type mismatches in your code.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;res1 and res2 in the main program are of type branch_plot_results_type.&amp;nbsp; In the procedure copy_branch_plot_results, these arguments are of type branch_plot_results_ppv_type.&lt;/P&gt;

&lt;P&gt;These two types are sequence types, but the sequence of components (considering attributes) in branch_plot_results_type is not the same as&amp;nbsp; the sequence of components in branch_plot_results_ppv_type.&lt;/P&gt;

&lt;P&gt;Edit - no - I'm fibbing.&amp;nbsp; Let me look at this further.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Nov 2013 02:18:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Memory-leak/m-p/916529#M84318</guid>
      <dc:creator>IanH</dc:creator>
      <dc:date>2013-11-21T02:18:00Z</dc:date>
    </item>
    <item>
      <title>It looks like a problem with</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Memory-leak/m-p/916530#M84319</link>
      <description>&lt;P&gt;It looks like a problem with intrinsic assignment of derived types with allocatable components?&amp;nbsp; What???&lt;/P&gt;

&lt;P&gt;And to think that I was about to post a lengthy rant about Inspector and false positives...&lt;/P&gt;

&lt;P&gt;(Instead I'll rant about the forum double spacing syntax highlighted bits in posts, and clicking upload in the file attachment bit creating another "Drag files here" section.)&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Nov 2013 03:42:32 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Memory-leak/m-p/916530#M84319</guid>
      <dc:creator>IanH</dc:creator>
      <dc:date>2013-11-21T03:42:32Z</dc:date>
    </item>
    <item>
      <title>Attempt twenty two.</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Memory-leak/m-p/916531#M84320</link>
      <description>&lt;P&gt;Attempt twenty two.&lt;/P&gt;

&lt;P&gt;[fortran]&lt;/P&gt;

&lt;P&gt;&lt;BR /&gt;
	program testy&lt;BR /&gt;
	&amp;nbsp; USE CrtMemoryUtilities&lt;BR /&gt;
	&amp;nbsp; USE, INTRINSIC :: ISO_C_BINDING, ONLY: C_INT&lt;BR /&gt;
	&amp;nbsp;&lt;BR /&gt;
	&amp;nbsp; implicit none&lt;BR /&gt;
	&amp;nbsp;&lt;BR /&gt;
	&amp;nbsp; type branch_plot_results_ppv_type&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; real(8)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; , allocatable&amp;nbsp; :: v(:)&lt;BR /&gt;
	&amp;nbsp; end type branch_plot_results_ppv_type&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;
	&amp;nbsp; type branch_plot_results_type&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; type(branch_plot_results_ppv_type), allocatable :: appv(:)&lt;BR /&gt;
	&amp;nbsp; end type branch_plot_results_type&lt;BR /&gt;
	&amp;nbsp;&lt;BR /&gt;
	&amp;nbsp; TYPE(CrtMemState) :: before, after, diff&lt;BR /&gt;
	&amp;nbsp; INTEGER(C_INT) :: rc&lt;BR /&gt;
	&amp;nbsp;&lt;BR /&gt;
	&amp;nbsp; ! This also conveniently gets any initialization of the IO&lt;BR /&gt;
	&amp;nbsp; ! runtime out of the road.&lt;BR /&gt;
	&amp;nbsp; PRINT "('Before:')"&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;
	&amp;nbsp; ! Reports for warnings go to stdout.&lt;BR /&gt;
	&amp;nbsp; rc = CrtSetReportMode(CRT_WARN, CRTDBG_MODE_FILE)&lt;BR /&gt;
	&amp;nbsp; rc = CrtSetReportFile(CRT_WARN, CRTDBG_FILE_STDOUT)&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;
	&amp;nbsp; ! Get and report the state of the heap at the start.&lt;BR /&gt;
	&amp;nbsp; CALL CrtMemCheckpoint(before)&lt;BR /&gt;
	&amp;nbsp; CALL CrtmemDumpStatistics(before)&lt;BR /&gt;
	&amp;nbsp;&lt;BR /&gt;
	&amp;nbsp; ! Put the action in a procedure so local allocatables will be cleaned up.&lt;BR /&gt;
	&amp;nbsp; call main&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;
	&amp;nbsp; ! Get and report the state of the heap after.&lt;BR /&gt;
	&amp;nbsp; CALL CrtMemCheckpoint(after)&lt;BR /&gt;
	&amp;nbsp; PRINT "('After:')"&lt;BR /&gt;
	&amp;nbsp; CALL CrtmemDumpStatistics(after)&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;
	&amp;nbsp; ! Report the difference.&lt;BR /&gt;
	&amp;nbsp; rc = CrtMemDifference(diff, before, after)&lt;BR /&gt;
	&amp;nbsp; PRINT "('Difference:')"&lt;BR /&gt;
	&amp;nbsp; CALL CrtmemDumpStatistics(diff)&lt;BR /&gt;
	&amp;nbsp;&lt;BR /&gt;
	contains&lt;BR /&gt;
	&amp;nbsp; SUBROUTINE main&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; type(branch_plot_results_type), allocatable :: res1, res2&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; allocate(res1)&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; allocate(res1%appv(1))&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ! #A&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; allocate(res1%appv(1)%v(30))&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; allocate(res2)&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; allocate(res2%appv(2))&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ! size must differ from #a above.&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; allocate(res2%appv(1)%v(40)) ! This not cleaned up.&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; res2 = res1&lt;BR /&gt;
	&amp;nbsp; END SUBROUTINE main&lt;BR /&gt;
	end program[/fortran]&lt;/P&gt;

&lt;P&gt;[plain]&lt;/P&gt;

&lt;P&gt;&amp;gt;ifort /check:all /warn:all /Fe:Testy.exe /standard-semantics /MTd CrtMemoryUtilities.f90 Testy.f90 &amp;amp;&amp;amp; Testy.exe&lt;BR /&gt;
	Intel(R) Visual Fortran Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version 14.0.1.139 Build 20131008&lt;BR /&gt;
	Copyright (C) 1985-2013 Intel Corporation.&amp;nbsp; All rights reserved.&lt;/P&gt;

&lt;P&gt;Microsoft (R) Incremental Linker Version 10.00.40219.01&lt;BR /&gt;
	Copyright (C) Microsoft Corporation.&amp;nbsp; All rights reserved.&lt;/P&gt;

&lt;P&gt;-out:Testy.exe&lt;BR /&gt;
	-subsystem:console&lt;BR /&gt;
	CrtMemoryUtilities.obj&lt;BR /&gt;
	Testy.obj&lt;BR /&gt;
	Before:&lt;BR /&gt;
	0 bytes in 0 Free Blocks.&lt;BR /&gt;
	8499 bytes in 7 Normal Blocks.&lt;BR /&gt;
	16194 bytes in 97 CRT Blocks.&lt;BR /&gt;
	0 bytes in 0 Ignore Blocks.&lt;BR /&gt;
	0 bytes in 0 Client Blocks.&lt;BR /&gt;
	Largest number used: 24693 bytes.&lt;BR /&gt;
	Total allocations: 34522 bytes.&lt;BR /&gt;
	After:&lt;BR /&gt;
	0 bytes in 0 Free Blocks.&lt;BR /&gt;
	8850 bytes in 8 Normal Blocks.&lt;BR /&gt;
	16194 bytes in 97 CRT Blocks.&lt;BR /&gt;
	0 bytes in 0 Ignore Blocks.&lt;BR /&gt;
	0 bytes in 0 Client Blocks.&lt;BR /&gt;
	Largest number used: 25998 bytes.&lt;BR /&gt;
	Total allocations: 36002 bytes.&lt;BR /&gt;
	Difference:&lt;BR /&gt;
	0 bytes in 0 Free Blocks.&lt;BR /&gt;
	351 bytes in 1 Normal Blocks.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt; Badness.&lt;BR /&gt;
	0 bytes in 0 CRT Blocks.&lt;BR /&gt;
	0 bytes in 0 Ignore Blocks.&lt;BR /&gt;
	0 bytes in 0 Client Blocks.&lt;BR /&gt;
	Largest number used: 1305 bytes.&lt;BR /&gt;
	Total allocations: 1480 bytes.[/plain]&lt;/P&gt;</description>
      <pubDate>Thu, 21 Nov 2013 03:45:19 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Memory-leak/m-p/916531#M84320</guid>
      <dc:creator>IanH</dc:creator>
      <dc:date>2013-11-21T03:45:19Z</dc:date>
    </item>
    <item>
      <title> 
Thanks Ian.</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Memory-leak/m-p/916532#M84321</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Thanks Ian.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Nov 2013 10:43:25 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Memory-leak/m-p/916532#M84321</guid>
      <dc:creator>qolin</dc:creator>
      <dc:date>2013-11-21T10:43:25Z</dc:date>
    </item>
    <item>
      <title>Thanks, we'll check this out.</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Memory-leak/m-p/916533#M84322</link>
      <description>&lt;P&gt;Thanks, we'll check this out.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Nov 2013 15:26:41 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Memory-leak/m-p/916533#M84322</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2013-11-21T15:26:41Z</dc:date>
    </item>
    <item>
      <title>Steve, Ian:</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Memory-leak/m-p/916534#M84323</link>
      <description>&lt;P&gt;Steve, Ian:&lt;/P&gt;

&lt;P&gt;It'll be most useful if both of you can comment on the general applicability of the code posted by Ian to test "badness" during variable allocation and deallocation in derived types.&lt;/P&gt;

&lt;P&gt;I'll be very curious to learn what Steve finds with the example provided by Ian on the intrinsic assignment of derived types with allocatable components.&lt;/P&gt;

&lt;P&gt;I'm working toward creating derived types&amp;nbsp;with allocatable components (as well as type-bound procedures) for computational calculations by many other users.&amp;nbsp;&amp;nbsp;I assumed there will not be&amp;nbsp;any&amp;nbsp;"memory leak" issues associated with it since I'm adhering strictly to the 2003 and 2008 standards.&amp;nbsp; The consumption of these types in user code will involve both intrinsic and defined assignments as allowed by the standard.&lt;/P&gt;

&lt;P&gt;However when I try out Ian's code on a couple of these types, I get "badness" in one of the types similar to what Ian shows with the type defined by the OP.&amp;nbsp; Whereas in&amp;nbsp;my other type, I get a "Debug Error!" from Microsoft Visual C++ Debug Library:&lt;/P&gt;

&lt;P&gt;[plain]&lt;/P&gt;

&lt;P&gt;[Red circle with x in the middle] Debug Error!&lt;/P&gt;

&lt;P&gt;Program: C:\\test\\TestMemLeak.exe&lt;/P&gt;

&lt;P&gt;Damage before 0x00183FA0 which was allocated by aligned routine&lt;/P&gt;

&lt;P&gt;(Press Retry to debug the application)&lt;/P&gt;

&lt;P&gt;[/plain]&lt;/P&gt;

&lt;P&gt;Does the above mean there is something seriously wrong with my code, or a&amp;nbsp;compiler bug, or is it an artifact of Microsoft's C run-time?&amp;nbsp; The above error occurs right when the RETURN statement is executed in the "CONTAIN"ed procedure (i.e., SUBROUTINE MAIN in Ian's example).&lt;/P&gt;

&lt;P&gt;Unfortunately I currently don't have access to Intel Inspector (I'd tried out a trial version a while ago but couldn't convince the management to get me a fully licensed copy and&amp;nbsp;I don't think&amp;nbsp;the system&amp;nbsp;will allow me to download it&amp;nbsp;again) to see what it finds on my derived types.&lt;/P&gt;

&lt;P&gt;But I'm now really worried about memory issues with the use of my derived types.&lt;/P&gt;

&lt;P&gt;Thanks much,&lt;/P&gt;</description>
      <pubDate>Mon, 25 Nov 2013 21:30:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Memory-leak/m-p/916534#M84323</guid>
      <dc:creator>FortranFan</dc:creator>
      <dc:date>2013-11-25T21:30:00Z</dc:date>
    </item>
    <item>
      <title>Steve, any advance on this?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Memory-leak/m-p/916535#M84324</link>
      <description>&lt;P&gt;Steve, any advance on this?&lt;/P&gt;</description>
      <pubDate>Sat, 01 Feb 2014 09:18:06 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Memory-leak/m-p/916535#M84324</guid>
      <dc:creator>qolin</dc:creator>
      <dc:date>2014-02-01T09:18:06Z</dc:date>
    </item>
    <item>
      <title>Steve,</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Memory-leak/m-p/916536#M84325</link>
      <description>&lt;P&gt;Steve,&lt;/P&gt;

&lt;P&gt;I see the leak I described in&amp;nbsp;my other thread (&lt;A href="http://software.intel.com/en-us/forums/topic/493597"&gt;http://software.intel.com/en-us/forums/topic/493597&lt;/A&gt;, "Another memory leak") has been assigned an Issue ID. Is this thead's problem the same, or different? Please give us an update, even if its "sorry, still looking".&lt;/P&gt;

&lt;P&gt;Qolin&lt;/P&gt;

&lt;P&gt;P.S. Thanks for the nice new green belt (does my bum look big in it?)&lt;/P&gt;</description>
      <pubDate>Fri, 14 Feb 2014 09:34:50 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Memory-leak/m-p/916536#M84325</guid>
      <dc:creator>qolin</dc:creator>
      <dc:date>2014-02-14T09:34:50Z</dc:date>
    </item>
    <item>
      <title>I don't think these are</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Memory-leak/m-p/916537#M84326</link>
      <description>&lt;P&gt;I don't think these are related. Using Ian's test code under 14.0.2 I see no leaks. I don't really see the leak you described in your original source either. Please try your real application with 14.0.2 and see what you find.&lt;/P&gt;

&lt;P&gt;I do still see the internal compiler error for the move_alloc call, though. That is fixed in the 15.0 compiler.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Feb 2014 18:54:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Memory-leak/m-p/916537#M84326</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2014-02-14T18:54:00Z</dc:date>
    </item>
    <item>
      <title>Quote:Steve Lionel (Intel)</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Memory-leak/m-p/916538#M84327</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;Steve Lionel (Intel) wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;I don't think these are related. Using Ian's test code under 14.0.2 I see no leaks. I don't really see the leak you described in your original source either. Please try your real application with 14.0.2 and see what you find.&lt;/P&gt;

&lt;P&gt;I do still see the internal compiler error for the move_alloc call, though. That is escalated as issue DPD200253435.&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Steve,&lt;/P&gt;

&lt;P&gt;Is 14.0.2 same as Service Pack 1, Update 2 - the latest version you said became available this week?&lt;/P&gt;

&lt;P&gt;When you say, "Using Ian's test code under 14.0.2 I see no leaks." - do you mean the "351 bytes&amp;nbsp; - badness" illustrated by Ian doesn't occur anymore?&amp;nbsp; If so, does that imply there was a compiler issue in the previous Intel version (say the one used by Ian) that has now been fixed?&lt;/P&gt;

&lt;P&gt;By the way, have you analyzed code containing derived types with allocatable components extensively in Intel Inspector/VTune Analyzer?&amp;nbsp;&amp;nbsp;Do you feel confident about the ability of these tools to catch any potential memory issues with the latest Fortran enhancements involving derived types and bound procedures that may heavy use of allocatables (I know technically there shouldn't be issues with allocatables unless one messes up royally, but what if there are compiler bugs)?&lt;/P&gt;

&lt;P&gt;I ask because I'm making heavy use of allocatables with derived types and TBPs&amp;nbsp;and when I run Ian's utility on my code, I get the "badness".&amp;nbsp; But my version is not up-to-date and I'm trying to convince management to upgrade my compiler&amp;nbsp;plus get me&amp;nbsp;these other tools.&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Feb 2014 20:30:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Memory-leak/m-p/916538#M84327</guid>
      <dc:creator>FortranFan</dc:creator>
      <dc:date>2014-02-14T20:30:00Z</dc:date>
    </item>
    <item>
      <title>When I ran Ian's test with 14</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Memory-leak/m-p/916539#M84328</link>
      <description>&lt;P&gt;When I ran Ian's test with 14.0.2 (yes, 2013 SP1 Update 2) it showed no leak. I do use Inspector to identify memory leaks. It's pretty reliable at saying whether or not there is a leak, and if so, where in the program the memory was allocated. But finding the cause of the leak takes more effort. I have not used VTune Amplifier XE in such investigations.&lt;/P&gt;</description>
      <pubDate>Sat, 15 Feb 2014 02:18:31 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Memory-leak/m-p/916539#M84328</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2014-02-15T02:18:31Z</dc:date>
    </item>
    <item>
      <title>Steve</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Memory-leak/m-p/916540#M84329</link>
      <description>&lt;P&gt;Steve&lt;/P&gt;

&lt;P&gt;OK thanks for all the updates. This time is my turn to apologise for not getting back to you sooner.&lt;/P&gt;

&lt;P&gt;Alas I am not in a position to try this on 14.0.2. So ...&lt;/P&gt;

&lt;P&gt;You say you ran ianH's test on 14.0.2 and it showed no leak, which sounds like very good news. Also you say "I cannot really see the leak in your original source either." ... more good news, hopefully this means the problem does not occur on 14.0.2.&lt;/P&gt;

&lt;P&gt;To vertify this, please amend my original test so it uses more memory: in the last call to MAKE1 (line 220), change the first &amp;nbsp;2 arguments: from 40 and 50, to 400 and 500. I have attached the source again with this change made.&lt;/P&gt;

&lt;P&gt;When&amp;nbsp;I run this on 13.1.3, it pretty quickly exhausts available memory for a 32-bit process.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Feb 2014 11:33:38 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Memory-leak/m-p/916540#M84329</guid>
      <dc:creator>qolin</dc:creator>
      <dc:date>2014-02-18T11:33:38Z</dc:date>
    </item>
    <item>
      <title>Well, this program does run</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Memory-leak/m-p/916541#M84330</link>
      <description>&lt;P&gt;Well, this program does run out of memory. I'll take another look.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Feb 2014 17:50:02 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Memory-leak/m-p/916541#M84330</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2014-02-18T17:50:02Z</dc:date>
    </item>
  </channel>
</rss>

