<?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: IMXRT1170 dynamic memory allocation in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/IMXRT1170-dynamic-memory-allocation/m-p/1499180#M193280</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/128940"&gt;@ahmedhrabi&lt;/a&gt;&amp;nbsp;，&lt;/P&gt;
&lt;P&gt;There's the feedback from the AE team.&lt;/P&gt;
&lt;P&gt;The Usage of 'Heap and Stack Usage' displays the maximum value which allocated, the usage value will update when the current allocated space larger than the previous allocated space, not update when the current allocated space smaller than the previous allocated space. In fact, the allocated space is released with the free function.&lt;/P&gt;
&lt;P&gt;Some test results is below:&lt;/P&gt;
&lt;P&gt;(1)&amp;nbsp;array = (int*)malloc(50* sizeof(int));&amp;nbsp; &amp;nbsp;the Usage displays 5.18%.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jeremyzhou_0-1659410717183.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/188737i3E652CECEAEF99A1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jeremyzhou_0-1659410717183.png" alt="jeremyzhou_0-1659410717183.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;(2) array = (int*)malloc(200* sizeof(int)); the Usage will update as 19.82%.&lt;/DIV&gt;
&lt;DIV&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jeremyzhou_1-1659410717330.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/188736iBD9CCAC52F4E15D2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jeremyzhou_1-1659410717330.png" alt="jeremyzhou_1-1659410717330.png" /&gt;&lt;/span&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;(3) array = (int*)malloc(50* sizeof(int)); the Usage will remain as 19.82%, which is consistent with the applied maximum space before.&lt;/DIV&gt;
&lt;DIV&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jeremyzhou_2-1659410717038.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/188734i57023A2DDFFD3030/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jeremyzhou_2-1659410717038.png" alt="jeremyzhou_2-1659410717038.png" /&gt;&lt;/span&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have a great day,&lt;BR /&gt;TIC&lt;/P&gt;
&lt;P&gt;-------------------------------------------------------------------------------&lt;BR /&gt;Note:&lt;BR /&gt;- If this post answers your question, please click the "Mark Correct" button. Thank you!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- We are following threads for 7 weeks after the last post, later replies are ignored&lt;BR /&gt;Please open a new thread and refer to the closed one, if you have a related question at a later point in time.&lt;BR /&gt;-------------------------------------------------------------------------------&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
    <pubDate>Tue, 02 Aug 2022 03:25:48 GMT</pubDate>
    <dc:creator>jeremyzhou</dc:creator>
    <dc:date>2022-08-02T03:25:48Z</dc:date>
    <item>
      <title>IMXRT1170 dynamic memory allocation</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/IMXRT1170-dynamic-memory-allocation/m-p/1496334#M193103</link>
      <description>&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;I'am testing dynamic memory usage on imxrt1176 on baremetal. When using standard C malloc() then free() functions, the allocated space is not released with the free function. The heap do not decrease:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MallocFreeImxrt.PNG" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/188045i95FD7DF8B440136E/image-size/large?v=v2&amp;amp;px=999" role="button" title="MallocFreeImxrt.PNG" alt="MallocFreeImxrt.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Regards,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ahmed.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jul 2022 11:34:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/IMXRT1170-dynamic-memory-allocation/m-p/1496334#M193103</guid>
      <dc:creator>ahmedhrabi</dc:creator>
      <dc:date>2022-07-27T11:34:22Z</dc:date>
    </item>
    <item>
      <title>Re: IMXRT1170 dynamic memory allocation</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/IMXRT1170-dynamic-memory-allocation/m-p/1497086#M193141</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.&lt;BR /&gt;In basic, I replicate the phenomenon you mentioned, further, I use the below code to find that MCUXpreso IDE can display the increasing heap usage.&lt;BR /&gt;I'll report the phenomenon to the IDE team for further checking soon later.&lt;/P&gt;
&lt;LI-CODE lang="c"&gt;    for(uint32_t i = 1; i &amp;lt; 5; i++)
    {
        int *array = (int*)malloc(32*sizeof(int)*i);
        if (NULL == array)
        {
        	return -1;
        }
        free(array);

        array = NULL;
    }&lt;/LI-CODE&gt;
&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;TIC&lt;/P&gt;
&lt;P&gt;-------------------------------------------------------------------------------&lt;BR /&gt;Note:&lt;BR /&gt;- If this post answers your question, please click the "Mark Correct" button. Thank you!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- We are following threads for 7 weeks after the last post, later replies are ignored&lt;BR /&gt;Please open a new thread and refer to the closed one, if you have a related question at a later point in time.&lt;BR /&gt;-------------------------------------------------------------------------------&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jul 2022 07:29:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/IMXRT1170-dynamic-memory-allocation/m-p/1497086#M193141</guid>
      <dc:creator>jeremyzhou</dc:creator>
      <dc:date>2022-07-28T07:29:40Z</dc:date>
    </item>
    <item>
      <title>Re: IMXRT1170 dynamic memory allocation</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/IMXRT1170-dynamic-memory-allocation/m-p/1499180#M193280</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/128940"&gt;@ahmedhrabi&lt;/a&gt;&amp;nbsp;，&lt;/P&gt;
&lt;P&gt;There's the feedback from the AE team.&lt;/P&gt;
&lt;P&gt;The Usage of 'Heap and Stack Usage' displays the maximum value which allocated, the usage value will update when the current allocated space larger than the previous allocated space, not update when the current allocated space smaller than the previous allocated space. In fact, the allocated space is released with the free function.&lt;/P&gt;
&lt;P&gt;Some test results is below:&lt;/P&gt;
&lt;P&gt;(1)&amp;nbsp;array = (int*)malloc(50* sizeof(int));&amp;nbsp; &amp;nbsp;the Usage displays 5.18%.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jeremyzhou_0-1659410717183.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/188737i3E652CECEAEF99A1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jeremyzhou_0-1659410717183.png" alt="jeremyzhou_0-1659410717183.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;(2) array = (int*)malloc(200* sizeof(int)); the Usage will update as 19.82%.&lt;/DIV&gt;
&lt;DIV&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jeremyzhou_1-1659410717330.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/188736iBD9CCAC52F4E15D2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jeremyzhou_1-1659410717330.png" alt="jeremyzhou_1-1659410717330.png" /&gt;&lt;/span&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;(3) array = (int*)malloc(50* sizeof(int)); the Usage will remain as 19.82%, which is consistent with the applied maximum space before.&lt;/DIV&gt;
&lt;DIV&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jeremyzhou_2-1659410717038.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/188734i57023A2DDFFD3030/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jeremyzhou_2-1659410717038.png" alt="jeremyzhou_2-1659410717038.png" /&gt;&lt;/span&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have a great day,&lt;BR /&gt;TIC&lt;/P&gt;
&lt;P&gt;-------------------------------------------------------------------------------&lt;BR /&gt;Note:&lt;BR /&gt;- If this post answers your question, please click the "Mark Correct" button. Thank you!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- We are following threads for 7 weeks after the last post, later replies are ignored&lt;BR /&gt;Please open a new thread and refer to the closed one, if you have a related question at a later point in time.&lt;BR /&gt;-------------------------------------------------------------------------------&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Tue, 02 Aug 2022 03:25:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/IMXRT1170-dynamic-memory-allocation/m-p/1499180#M193280</guid>
      <dc:creator>jeremyzhou</dc:creator>
      <dc:date>2022-08-02T03:25:48Z</dc:date>
    </item>
  </channel>
</rss>

