<?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 Re: threads created are retained in memory even after use in Intel® Moderncode for Parallel Architectures</title>
    <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/threads-created-are-retained-in-memory-even-after-use/m-p/903529#M4312</link>
    <description>&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
&lt;BR /&gt;I forgot to mention that on x32 the seperate process with memory mapped file permits you to effectively overlap two 2GB applicaions. e.g. with 500MB mapped total memory is 3.5GB.&lt;BR /&gt;&lt;BR /&gt;Jim&lt;BR /&gt;</description>
    <pubDate>Wed, 05 Aug 2009 14:01:48 GMT</pubDate>
    <dc:creator>jimdempseyatthecove</dc:creator>
    <dc:date>2009-08-05T14:01:48Z</dc:date>
    <item>
      <title>threads created are retained in memory even after use</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/threads-created-are-retained-in-memory-even-after-use/m-p/903525#M4308</link>
      <description>Hi,&lt;BR /&gt;I am using intel compiler for OpenMP parallel processing support in VC++ 6.0. One component which uses OpenMP for parallel processing is loaded at runtime by using LoadLibrary call. After use, it will be unloaded. My problem is that every time when I use this component, new threads are getting created. Old threads created in previous runs are still in memory.&lt;BR /&gt;So the threadstack is consuming a large amount of memory.&lt;BR /&gt;Is there any way to close threads created by omp_set_num_threads.</description>
      <pubDate>Tue, 04 Aug 2009 08:58:43 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/threads-created-are-retained-in-memory-even-after-use/m-p/903525#M4308</guid>
      <dc:creator>royjoseph</dc:creator>
      <dc:date>2009-08-04T08:58:43Z</dc:date>
    </item>
    <item>
      <title>Re: threads created are retained in memory even after use</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/threads-created-are-retained-in-memory-even-after-use/m-p/903526#M4309</link>
      <description>&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
&lt;BR /&gt;Can you structure your application to leave the library open?&lt;BR /&gt;&lt;BR /&gt;Jim&lt;BR /&gt;</description>
      <pubDate>Tue, 04 Aug 2009 12:21:33 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/threads-created-are-retained-in-memory-even-after-use/m-p/903526#M4309</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2009-08-04T12:21:33Z</dc:date>
    </item>
    <item>
      <title>Re: threads created are retained in memory even after use</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/threads-created-are-retained-in-memory-even-after-use/m-p/903527#M4310</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="margin-top: 5px; width: 100%;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/99850"&gt;jimdempseyatthecove&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;&lt;BR /&gt;Can you structure your application to leave the library open?&lt;BR /&gt;&lt;BR /&gt;Jim&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;Thanks Jim..&lt;BR /&gt;It worked fine after I made the library to stay in memory even after use. But I would like to know if there is any way to cleanup the thread/threadpool cretaed during runtime after its use.</description>
      <pubDate>Wed, 05 Aug 2009 06:18:07 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/threads-created-are-retained-in-memory-even-after-use/m-p/903527#M4310</guid>
      <dc:creator>royjoseph</dc:creator>
      <dc:date>2009-08-05T06:18:07Z</dc:date>
    </item>
    <item>
      <title>Re: threads created are retained in memory even after use</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/threads-created-are-retained-in-memory-even-after-use/m-p/903528#M4311</link>
      <description>&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
&lt;BR /&gt;I do not think there is a formal (clean) way to do this.&lt;BR /&gt;&lt;BR /&gt;You could:&lt;BR /&gt;&lt;BR /&gt;a) make note of the handles for threads you create independent of OpenMP&lt;BR /&gt;b) ASSUME all other threads are cancelable&lt;BR /&gt;c) terminate threads not in your list of your managed threads&lt;BR /&gt;&lt;BR /&gt;As to if this will crash your application now, or later, is purely speculative.&lt;BR /&gt;&lt;BR /&gt;The cost of keeping the library and threads in memory are some portion of your virtual memory is consumed and some system resources. When on x64 platform this should not be of concern. On x32 this may be of concern when your application is tight on space/resources.&lt;BR /&gt;&lt;BR /&gt;Because your initial design was to &lt;BR /&gt;&lt;BR /&gt; load the OpenMP runtime library&lt;BR /&gt; launch OpenMP parallel regions&lt;BR /&gt; consolidate back to the "main" thread that launched the OpenMP parallel regions&lt;BR /&gt; terminate the OpenMP threads (somehow)&lt;BR /&gt; unload the OpenMP runtime library&lt;BR /&gt;&lt;BR /&gt;Then periodically do the above again and again in your application&lt;BR /&gt;&lt;BR /&gt;I can only guess that the memory footprint concerns is more important than the runtime overhead in starting and stopping the OpenMP environment. This may be a legitimate concern.&lt;BR /&gt;&lt;BR /&gt;As a work around (assuming you must reclaim the memory)&lt;BR /&gt;&lt;BR /&gt;Encapsulate you parallel code into an application (execuitable).&lt;BR /&gt;From the original app then launch the encapsulated parallel code as a seperate process.&lt;BR /&gt;Then have the original app and parallel app use memory mapped files to map common data.&lt;BR /&gt;When you wish to exit the OpenMP code, your application simply terminates (taking all its OpenMP threads with it).&lt;BR /&gt;&lt;BR /&gt;Jim Dempsey&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 05 Aug 2009 13:09:16 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/threads-created-are-retained-in-memory-even-after-use/m-p/903528#M4311</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2009-08-05T13:09:16Z</dc:date>
    </item>
    <item>
      <title>Re: threads created are retained in memory even after use</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/threads-created-are-retained-in-memory-even-after-use/m-p/903529#M4312</link>
      <description>&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
&lt;BR /&gt;I forgot to mention that on x32 the seperate process with memory mapped file permits you to effectively overlap two 2GB applicaions. e.g. with 500MB mapped total memory is 3.5GB.&lt;BR /&gt;&lt;BR /&gt;Jim&lt;BR /&gt;</description>
      <pubDate>Wed, 05 Aug 2009 14:01:48 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/threads-created-are-retained-in-memory-even-after-use/m-p/903529#M4312</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2009-08-05T14:01:48Z</dc:date>
    </item>
    <item>
      <title>Re: threads created are retained in memory even after use</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/threads-created-are-retained-in-memory-even-after-use/m-p/903530#M4313</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="margin-top: 5px; width: 100%;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/99850"&gt;jimdempseyatthecove&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;&lt;BR /&gt;I forgot to mention that on x32 the seperate process with memory mapped file permits you to effectively overlap two 2GB applicaions. e.g. with 500MB mapped total memory is 3.5GB.&lt;BR /&gt;&lt;BR /&gt;Jim&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;Currently I will stick to keeping DLL loaded in memory after use.&lt;BR /&gt;Thanks Jim for detailed reply.</description>
      <pubDate>Fri, 07 Aug 2009 05:15:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/threads-created-are-retained-in-memory-even-after-use/m-p/903530#M4313</guid>
      <dc:creator>royjoseph</dc:creator>
      <dc:date>2009-08-07T05:15:00Z</dc:date>
    </item>
  </channel>
</rss>

