<?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: Memory growth in DPC++ application with USM in Intel® oneAPI DPC++/C++ Compiler</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Memory-growth-in-DPC-application-with-USM/m-p/1399984#M2355</link>
    <description>&lt;P&gt;Thank you for the update!&lt;/P&gt;
&lt;P&gt;I've confirmed that the memory growth issue seems to be solved on 2022.2.&lt;/P&gt;
&lt;P&gt;As well as the code above, my application does not have the memory problem anymore!&lt;/P&gt;</description>
    <pubDate>Wed, 13 Jul 2022 12:21:41 GMT</pubDate>
    <dc:creator>baranovsky</dc:creator>
    <dc:date>2022-07-13T12:21:41Z</dc:date>
    <item>
      <title>Memory growth in DPC++ application with USM</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Memory-growth-in-DPC-application-with-USM/m-p/1351058#M1826</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I'm developing a fluid simulator using DPC++, but the application's memory consumption grows so rapidly that practical simulation cannot be ran.&lt;/P&gt;
&lt;P&gt;As kernel functions executed repeatedly, the memory consumption of my application monotonously grows. And, the memory growth will not reset even if sycl::queue is deleted.&lt;/P&gt;
&lt;P&gt;I attached a small source code which reproduced the problem in my environment:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; Windows 11 Enterprise&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; Microsoft Visual Studio Professional 2019 Version 16.11.8&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; Intel oneAPI 2021.4&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there any idea for the cause, and possible solutions?&lt;/P&gt;
&lt;P&gt;Thank you for your help in advance.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;--- source code (which I failed to attach as a file) ---&lt;/P&gt;
&lt;P&gt;#include &amp;lt;CL/sycl.hpp&amp;gt;&lt;/P&gt;
&lt;P&gt;int main(int argc, char* argv[])&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; for (auto loop = 0; loop &amp;lt; 2; loop++)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;std::cout &amp;lt;&amp;lt; "loop #" &amp;lt;&amp;lt; loop &amp;lt;&amp;lt; std::endl;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;sycl::queue queue(sycl::cpu_selector{});&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;auto* data = sycl::malloc_device&amp;lt;double&amp;gt;(1024, queue);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;sycl::event e;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;for (auto i = 0; i &amp;lt; 100000; i++)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;e = queue.submit([data, e](sycl::handler&amp;amp; cgh)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;cgh.depends_on(e);&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;cgh.parallel_for(sycl::range&amp;lt;1&amp;gt;(1024), [data](sycl::item&amp;lt;1&amp;gt; item)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;data[item.get_linear_id()] = item.get_linear_id();&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;});&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;});&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;queue.wait();&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;sycl::free(data, queue);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;return 0;&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jan 2022 05:59:52 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Memory-growth-in-DPC-application-with-USM/m-p/1351058#M1826</guid>
      <dc:creator>baranovsky</dc:creator>
      <dc:date>2022-01-13T05:59:52Z</dc:date>
    </item>
    <item>
      <title>Re:Memory growth in DPC++ application with USM</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Memory-growth-in-DPC-application-with-USM/m-p/1351116#M1827</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thanks for reaching out to us.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;I&gt;&amp;gt;&amp;gt;the memory consumption of my application monotonously grows And, the memory growth will not reset even if sycl::queue is deleted.&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Could you please elaborate more about the above statement?&lt;/P&gt;&lt;P&gt;Also please&amp;nbsp;do let us know, how did you test the memory consumption of the application?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Also could you please confirm the issue with the latest version of oneAPI which is 2022.1?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Noorjahan&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 13 Jan 2022 12:29:30 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Memory-growth-in-DPC-application-with-USM/m-p/1351116#M1827</guid>
      <dc:creator>NoorjahanSk_Intel</dc:creator>
      <dc:date>2022-01-13T12:29:30Z</dc:date>
    </item>
    <item>
      <title>Re: Memory growth in DPC++ application with USM</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Memory-growth-in-DPC-application-with-USM/m-p/1351450#M1828</link>
      <description>&lt;P&gt;Thank you Noorjahan.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've tested my application with Visual Studio's "&lt;SPAN&gt;Diagnostic Tools".&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;When I change the source code to loop the first for-loop 100 times, the process memory grows from 100MB to 900MB.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I've also confirmed the issue with the latest version (&lt;/SPAN&gt;&lt;SPAN style="font-family: inherit;"&gt;Intel oneAPI 2022.1)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;&lt;SPAN&gt;(please see the image attached: 2021.4.png and 2022.1.png)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jan 2022 09:54:59 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Memory-growth-in-DPC-application-with-USM/m-p/1351450#M1828</guid>
      <dc:creator>baranovsky</dc:creator>
      <dc:date>2022-01-14T09:54:59Z</dc:date>
    </item>
    <item>
      <title>Re: Memory growth in DPC++ application with USM</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Memory-growth-in-DPC-application-with-USM/m-p/1351477#M1829</link>
      <description>&lt;P&gt;I found a lead: changing /O* compiler option solved the issue.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;/O2 :&amp;nbsp; memory grows monotonously, as reported above.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;/Od : memory growth is reasonable (please see the attached file)&lt;/P&gt;
&lt;P&gt;I'm wondering if I am missing something important, or if&amp;nbsp;this is a bug in the compiler...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anyway, I need a more practical solution (other than using /Od option forever),&lt;/P&gt;
&lt;P&gt;since&amp;nbsp; /Od option slows down the application compared to /O2.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jan 2022 11:56:52 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Memory-growth-in-DPC-application-with-USM/m-p/1351477#M1829</guid>
      <dc:creator>baranovsky</dc:creator>
      <dc:date>2022-01-14T11:56:52Z</dc:date>
    </item>
    <item>
      <title>Re:Memory growth in DPC++ application with USM</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Memory-growth-in-DPC-application-with-USM/m-p/1355024#M1861</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;We are working on your issue. We will get back to you soon.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Noorjahan.&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 27 Jan 2022 06:48:25 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Memory-growth-in-DPC-application-with-USM/m-p/1355024#M1861</guid>
      <dc:creator>NoorjahanSk_Intel</dc:creator>
      <dc:date>2022-01-27T06:48:25Z</dc:date>
    </item>
    <item>
      <title>Re: Memory growth in DPC++ application with USM</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Memory-growth-in-DPC-application-with-USM/m-p/1356918#M1867</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi Noorjahan,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm glad to hear that. thank you!&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;If it takes long to fix and you have any workaround for this issue, could you share the workarounds?&lt;/P&gt;
&lt;P&gt;Because compile-with-/Od did not work for my project ...&lt;/P&gt;</description>
      <pubDate>Thu, 03 Feb 2022 01:25:48 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Memory-growth-in-DPC-application-with-USM/m-p/1356918#M1867</guid>
      <dc:creator>baranovsky</dc:creator>
      <dc:date>2022-02-03T01:25:48Z</dc:date>
    </item>
    <item>
      <title>Re:Memory growth in DPC++ application with USM</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Memory-growth-in-DPC-application-with-USM/m-p/1361795#M1896</link>
      <description>&lt;P&gt;Hello Shoeji - I have been looking at this issue. It has been reproduced, and I have gone ahead and filed a ticket on this directly with the development team. I will provide you updates as soon as development takes a look at this. Thank you for your patience.&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 18 Feb 2022 23:53:53 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Memory-growth-in-DPC-application-with-USM/m-p/1361795#M1896</guid>
      <dc:creator>clevels</dc:creator>
      <dc:date>2022-02-18T23:53:53Z</dc:date>
    </item>
    <item>
      <title>Re:Memory growth in DPC++ application with USM</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Memory-growth-in-DPC-application-with-USM/m-p/1399798#M2353</link>
      <description>&lt;P&gt;Hello- there has been an update from the development team. With the oneAPI 2022.1.0 compiler they are seeing the following memory consumption graph using massif, which seems to be in line with what is expected:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://isvc.file.force.com/servlet/rtaImage?refid=0EM4U000002iBH4" /&gt;&lt;/P&gt;&lt;P&gt;If you are still able to reproduce this issue with the latest version, could you please provide detailed steps (compilation and run commands) along with the compiler and OpenCL CPU runtime versions?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;run commands for above graph:&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;$dpcpp test.cpp&lt;/P&gt;&lt;P&gt;$valgrind --tool=massif ./a.out&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 18 Feb 2026 14:36:08 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Memory-growth-in-DPC-application-with-USM/m-p/1399798#M2353</guid>
      <dc:creator>clevels</dc:creator>
      <dc:date>2026-02-18T14:36:08Z</dc:date>
    </item>
    <item>
      <title>Re: Memory growth in DPC++ application with USM</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Memory-growth-in-DPC-application-with-USM/m-p/1399984#M2355</link>
      <description>&lt;P&gt;Thank you for the update!&lt;/P&gt;
&lt;P&gt;I've confirmed that the memory growth issue seems to be solved on 2022.2.&lt;/P&gt;
&lt;P&gt;As well as the code above, my application does not have the memory problem anymore!&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jul 2022 12:21:41 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Memory-growth-in-DPC-application-with-USM/m-p/1399984#M2355</guid>
      <dc:creator>baranovsky</dc:creator>
      <dc:date>2022-07-13T12:21:41Z</dc:date>
    </item>
  </channel>
</rss>

