<?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>MQX Software SolutionsのトピックRe: Memory optimization in RTCS</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/Memory-optimization-in-RTCS/m-p/1158184#M18544</link>
    <description>&lt;P&gt;With TAD, you can see that every new TCP socket connection needs extra 500+4392x2+148=9432B as follows:&lt;/P&gt;
&lt;P&gt;MQX -&amp;gt; Lightweight Memory Block Summary&lt;BR /&gt;Size (Decimal) Owner Type&lt;BR /&gt;500 0x10001 TCP Control Block;RTCS/TCP&lt;BR /&gt;4392 0x10001 TCP Tx Window;RTCS/TCP&lt;BR /&gt;4392 0x10001 TCP Rx Window;RTCS/TCP&lt;BR /&gt;148 0x10001 TCP Send Clock;RTCS/TCP&lt;BR /&gt;(TCP/IP Task id is 0x10001)&lt;/P&gt;
&lt;P&gt;The default OPT_TBSIZE and OPT_RBSIZE are 4380 bytes. If you call setsockopt() to reduce these two, for example, to a quarter like 1095 bytes, the memory usage to open a new TCP socket will drop from 16% to 4.7% as follows:&lt;/P&gt;
&lt;P&gt;MQX -&amp;gt; Lightweight Memory Block Summary&lt;BR /&gt;Size (Decimal) Owner Type&lt;BR /&gt;500 -&amp;gt; 500 0x10001 TCP Control Block;RTCS/TCP&lt;BR /&gt;4392 -&amp;gt; 1108 0x10001 TCP Tx Window;RTCS/TCP&lt;BR /&gt;4392 -&amp;gt; 1108 0x10001 TCP Rx Window;RTCS/TCP&lt;BR /&gt;148 -&amp;gt; 84 0x10001 TCP Send Clock;RTCS/TCP&lt;/P&gt;
&lt;P&gt;If the problem persists please set a slower number, try next: &lt;BR /&gt;uint_32 value;&lt;BR /&gt;… &lt;BR /&gt;value = 256; &lt;BR /&gt;setsockopt(sock, SOL_TCP,OPT_TBSIZE,&amp;amp;value,sizeof(value)); &lt;BR /&gt;setsockopt(sock, SOL_TCP,OPT_RBSIZE,&amp;amp;value,sizeof(value));&lt;/P&gt;
&lt;P&gt;Also, it might be possible that you need more PCBs, MSG and sockets. Could you please add the next lines just before call the function RTCS_create() just as the web_hvac does in the C:\Program Files\Freescale\Freescale MQX 3.5\demo\web_hvac\RTCS.c file?&lt;BR /&gt;/* runtime RTCS configuration */&lt;BR /&gt;_RTCSPCB_init = 4; &lt;BR /&gt;_RTCSPCB_grow = 2; &lt;BR /&gt;_RTCSPCB_max = 20; &lt;BR /&gt;_RTCS_msgpool_init = 4; &lt;BR /&gt;_RTCS_msgpool_grow = 2; &lt;BR /&gt;_RTCS_msgpool_max = 20; &lt;BR /&gt;_RTCS_socket_part_init = 4; &lt;BR /&gt;_RTCS_socket_part_grow = 2; &lt;BR /&gt;_RTCS_socket_part_max = 20;&lt;/P&gt;</description>
    <pubDate>Thu, 24 Sep 2020 01:04:46 GMT</pubDate>
    <dc:creator>danielchen</dc:creator>
    <dc:date>2020-09-24T01:04:46Z</dc:date>
    <item>
      <title>Memory optimization in RTCS</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Memory-optimization-in-RTCS/m-p/1158093#M18542</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using MQX and RTCS on an K60 processor. when I debug, I found a memory error&amp;nbsp;&amp;nbsp;message. where connecting a&amp;nbsp;new socket reports an error with available TCP/IP buffers. With TAD, it reports to 95% full.&lt;/P&gt;&lt;P&gt;how can I optimized this? Are there any tips?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Sep 2020 21:49:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Memory-optimization-in-RTCS/m-p/1158093#M18542</guid>
      <dc:creator>antonychen2008</dc:creator>
      <dc:date>2020-09-23T21:49:51Z</dc:date>
    </item>
    <item>
      <title>Re: Memory optimization in RTCS</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Memory-optimization-in-RTCS/m-p/1158184#M18544</link>
      <description>&lt;P&gt;With TAD, you can see that every new TCP socket connection needs extra 500+4392x2+148=9432B as follows:&lt;/P&gt;
&lt;P&gt;MQX -&amp;gt; Lightweight Memory Block Summary&lt;BR /&gt;Size (Decimal) Owner Type&lt;BR /&gt;500 0x10001 TCP Control Block;RTCS/TCP&lt;BR /&gt;4392 0x10001 TCP Tx Window;RTCS/TCP&lt;BR /&gt;4392 0x10001 TCP Rx Window;RTCS/TCP&lt;BR /&gt;148 0x10001 TCP Send Clock;RTCS/TCP&lt;BR /&gt;(TCP/IP Task id is 0x10001)&lt;/P&gt;
&lt;P&gt;The default OPT_TBSIZE and OPT_RBSIZE are 4380 bytes. If you call setsockopt() to reduce these two, for example, to a quarter like 1095 bytes, the memory usage to open a new TCP socket will drop from 16% to 4.7% as follows:&lt;/P&gt;
&lt;P&gt;MQX -&amp;gt; Lightweight Memory Block Summary&lt;BR /&gt;Size (Decimal) Owner Type&lt;BR /&gt;500 -&amp;gt; 500 0x10001 TCP Control Block;RTCS/TCP&lt;BR /&gt;4392 -&amp;gt; 1108 0x10001 TCP Tx Window;RTCS/TCP&lt;BR /&gt;4392 -&amp;gt; 1108 0x10001 TCP Rx Window;RTCS/TCP&lt;BR /&gt;148 -&amp;gt; 84 0x10001 TCP Send Clock;RTCS/TCP&lt;/P&gt;
&lt;P&gt;If the problem persists please set a slower number, try next: &lt;BR /&gt;uint_32 value;&lt;BR /&gt;… &lt;BR /&gt;value = 256; &lt;BR /&gt;setsockopt(sock, SOL_TCP,OPT_TBSIZE,&amp;amp;value,sizeof(value)); &lt;BR /&gt;setsockopt(sock, SOL_TCP,OPT_RBSIZE,&amp;amp;value,sizeof(value));&lt;/P&gt;
&lt;P&gt;Also, it might be possible that you need more PCBs, MSG and sockets. Could you please add the next lines just before call the function RTCS_create() just as the web_hvac does in the C:\Program Files\Freescale\Freescale MQX 3.5\demo\web_hvac\RTCS.c file?&lt;BR /&gt;/* runtime RTCS configuration */&lt;BR /&gt;_RTCSPCB_init = 4; &lt;BR /&gt;_RTCSPCB_grow = 2; &lt;BR /&gt;_RTCSPCB_max = 20; &lt;BR /&gt;_RTCS_msgpool_init = 4; &lt;BR /&gt;_RTCS_msgpool_grow = 2; &lt;BR /&gt;_RTCS_msgpool_max = 20; &lt;BR /&gt;_RTCS_socket_part_init = 4; &lt;BR /&gt;_RTCS_socket_part_grow = 2; &lt;BR /&gt;_RTCS_socket_part_max = 20;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Sep 2020 01:04:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Memory-optimization-in-RTCS/m-p/1158184#M18544</guid>
      <dc:creator>danielchen</dc:creator>
      <dc:date>2020-09-24T01:04:46Z</dc:date>
    </item>
  </channel>
</rss>

