<?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 manager optimization in LabVIEW</title>
    <link>https://ni.lithium.com/t5/LabVIEW/memory-manager-optimization/m-p/3201032#M928126</link>
    <description>&lt;P&gt;the LabVIEW 2014 Profile Perfromance and Memory&amp;nbsp; says case 1 is using 3 MBy and the other case is using 4MBy&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That was the metric. This is on Windows, not RT.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;mcduff&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See &lt;A href="http://forums.ni.com/t5/LabVIEW/Queue-Memory-Allocation-Weirdness/m-p/1990809#M656598" target="_blank"&gt;http://forums.ni.com/t5/LabVIEW/Queue-Memory-Allocation-Weirdness/m-p/1990809#M656598&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;for strange memory probelms regarding queues&lt;/P&gt;</description>
    <pubDate>Wed, 07 Oct 2015 19:05:02 GMT</pubDate>
    <dc:creator>mcduff</dc:creator>
    <dc:date>2015-10-07T19:05:02Z</dc:date>
    <item>
      <title>memory manager optimization</title>
      <link>https://ni.lithium.com/t5/LabVIEW/memory-manager-optimization/m-p/3200987#M928104</link>
      <description>&lt;P&gt;I'm carrying a pre-allocated U8 buffer array on a shift register, dumping the 'active' portion of it to disk when it is getting 'close to full'.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My overall goal is to reduce calls to the memory manager as much as possible for this particular code. &amp;nbsp;I insert data into the buffer array using in-place "array split / replace sub-arrays" which seems like a good idea(?), but when I go to get the 'data' portion of the buffer, am I better off using the in-place to get the sub-array (the size of which is close to the max size of the buffer array itself), or is it better to use 'Array Subset'?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My thinking is that the 'in-place' might be better since I'm not creating a copy of the main array, while if I wire the main array to 'Array subset' I have a branch/split on that wire, which creates a (new) copy of the whole array (except buffer allocation seems to indicate I don't on the input, but I do on the output.. sort of opposite of the in-place structure)?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;On the other hand, the in-place shows two buffer allocations; the total size equaling the size of the buffer array, and another allocation on the write binary file VI anyway...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I always have a hard time trying to 'reason' or 'think' myself to the ideal solution in this type of a problem. &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt; &amp;nbsp;Pointers and insight would be appreciated. &amp;nbsp;Again, I'm trying to reduce dynamic memory alloc/dealloc as much as possible, not necessarily looking to maximize (cpu) performance.&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://ip1.i.lithium.com/813a6e7c7dd71784ef9ae78a67c37df76a893e7d/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f31373331393969344343324644413145323339383537362f696d6167652d73697a652f6f726967696e616c3f763d6d70626c2d312670783d2d31" border="0" alt="in place or not.png" title="in place or not.png" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Oct 2015 17:57:29 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/memory-manager-optimization/m-p/3200987#M928104</guid>
      <dc:creator>QFang</dc:creator>
      <dc:date>2015-10-07T17:57:29Z</dc:date>
    </item>
    <item>
      <title>Re: memory manager optimization</title>
      <link>https://ni.lithium.com/t5/LabVIEW/memory-manager-optimization/m-p/3201003#M928113</link>
      <description>&lt;P&gt;Unfortunately, I think somebody from NI will have to chime in here to get a definate answer.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But based on my limited understanding, the Array Subset will not make a copy of the entire array, but the subset you are getting.&amp;nbsp; Supposedly, the compiler is smart enough to allow the read functions for the array happen before the write functions when on the same wire (branches count).&amp;nbsp; If multiple write functions, then a copy will be make for that second write function.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm not completely sold on the IPES helping here based on what I just stated.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Oct 2015 18:11:21 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/memory-manager-optimization/m-p/3201003#M928113</guid>
      <dc:creator>crossrulz</dc:creator>
      <dc:date>2015-10-07T18:11:21Z</dc:date>
    </item>
    <item>
      <title>Re: memory manager optimization</title>
      <link>https://ni.lithium.com/t5/LabVIEW/memory-manager-optimization/m-p/3201004#M928114</link>
      <description>&lt;P&gt;I always use a construct like your first diagram, the in-place structure.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;mcduff&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Oct 2015 18:16:41 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/memory-manager-optimization/m-p/3201004#M928114</guid>
      <dc:creator>mcduff</dc:creator>
      <dc:date>2015-10-07T18:16:41Z</dc:date>
    </item>
    <item>
      <title>Re: memory manager optimization</title>
      <link>https://ni.lithium.com/t5/LabVIEW/memory-manager-optimization/m-p/3201005#M928115</link>
      <description>&lt;P&gt;Good question. &amp;nbsp;I don't know the answer, and even if I said I did, why should you believe me (and who says that this would be true on&amp;nbsp;&lt;U&gt;your&lt;/U&gt; machine and with&amp;nbsp;&lt;U&gt;your&lt;/U&gt; version of LabVIEW)?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Besides, I'm a Scientist, so my answer would be "Do the Experiment". &amp;nbsp;Write a little test routine, put timing code around it, and see how long it takes to do a reasonable number of writes similar to what you'd want to do with your code. &amp;nbsp;Do it with the In Place method, then with the Subset method, and compare.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Several years ago, Darren Nattinger (who I believe still holds the title of The World's Fastest LabVIEW Coder) gave a very interesting talk at NI Week asking "Which way is faster?" &amp;nbsp;The audience voted among three alternatives, and in most cases, the correct answer (which he demonstrated by rinning the code with timers surrounding it) was chosen by the&amp;nbsp;&lt;U&gt;smallest&lt;/U&gt; nujmber of people.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You have to "do the experiment" ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bob Schor&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;P.S. -- when you've done it, let us know the results!&lt;/P&gt;</description>
      <pubDate>Wed, 07 Oct 2015 18:16:51 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/memory-manager-optimization/m-p/3201005#M928115</guid>
      <dc:creator>Bob_Schor</dc:creator>
      <dc:date>2015-10-07T18:16:51Z</dc:date>
    </item>
    <item>
      <title>Re: memory manager optimization</title>
      <link>https://ni.lithium.com/t5/LabVIEW/memory-manager-optimization/m-p/3201007#M928116</link>
      <description>&lt;P&gt;I would lie to chime in if you are testing for memory.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Use the Windows Memory Task Manager to watch the memory when you do the two tests. Make array of 1 million or so of the data type you have, with 1 million points it should be easier to tell the memory usage. Check the task manager to see if any copies of the data are made. I did this in the past, do not remember which LabVIEW version, the IPE was better for memory, not sure about speed. I do not know if new versions have changed so case 2 uses the same amount of memory as case 1.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;mcduff&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Oct 2015 18:24:45 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/memory-manager-optimization/m-p/3201007#M928116</guid>
      <dc:creator>mcduff</dc:creator>
      <dc:date>2015-10-07T18:24:45Z</dc:date>
    </item>
    <item>
      <title>Re: memory manager optimization</title>
      <link>https://ni.lithium.com/t5/LabVIEW/memory-manager-optimization/m-p/3201009#M928118</link>
      <description>&lt;P&gt;McDuff is clearly another Scientist, who says "Do the Experiment" ... &amp;nbsp;Lay On, McDuff ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BS&lt;/P&gt;</description>
      <pubDate>Wed, 07 Oct 2015 18:29:38 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/memory-manager-optimization/m-p/3201009#M928118</guid>
      <dc:creator>Bob_Schor</dc:creator>
      <dc:date>2015-10-07T18:29:38Z</dc:date>
    </item>
    <item>
      <title>Re: memory manager optimization</title>
      <link>https://ni.lithium.com/t5/LabVIEW/memory-manager-optimization/m-p/3201022#M928119</link>
      <description>&lt;P&gt;Oh I run 'experiments' all day long, trust me.. My issue here is that I am not aware of a good way to run a MEMORY test on an RT target. &amp;nbsp;I already know that IPE often (but not always) take LONGER to run than not using it... But I am at a loss for how to test memory allocation/deallocation (on an RT system). &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm actually oposite of mcduff when it comes to usage of IPE's. &amp;nbsp;A year ago or so, I started making extensive use of IPE's, until I found that it really ate up a lot of CPU, at least in the cases and in the manner I tried to use them back then, so my general take is to never use them unless there is a very good reason/chance that it will actually be beneficial.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Even on a Windows platform, I'm not quite sure how I would get detailed information. &amp;nbsp;Keep in mind, memory usage isn't the exact metric I'm looking for.. I'm looking for if the memory is re-used without calls to the memory handler (on an RT target) or not. &amp;nbsp;blergh.. I feeling like I'm doing a poor job explaining what I mean. sorry guys..&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Oct 2015 18:52:12 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/memory-manager-optimization/m-p/3201022#M928119</guid>
      <dc:creator>QFang</dc:creator>
      <dc:date>2015-10-07T18:52:12Z</dc:date>
    </item>
    <item>
      <title>Re: memory manager optimization</title>
      <link>https://ni.lithium.com/t5/LabVIEW/memory-manager-optimization/m-p/3201024#M928121</link>
      <description>&lt;P&gt;According to the LabVIEW 2014 Profile Perfromance and Memory ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This Case 1 snippet is the best&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://ip1.i.lithium.com/f0544b125d949c0e04573fa908b1b24bbb6d8380/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f31373332303369303031334643353345314446464643342f696d6167652d73697a652f6f726967696e616c3f763d6d70626c2d312670783d2d31" border="0" alt="Case1.png" title="Case1.png" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Strangely, without the DVR it is worse than the array subset, snippet below&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://ip1.i.lithium.com/c57b23fdda042a60fd67dd05edc7edcf62cc9602/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f31373332303569343241363946423039453834454238342f696d6167652d73697a652f6f726967696e616c3f763d6d70626c2d312670783d2d31" border="0" alt="Untitled4.png" title="Untitled4.png" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think you need to test in your application, ie, in a subVI with an array in and array out, if everything is inlined than not copies should be made.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;mcduff&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Oct 2015 18:53:08 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/memory-manager-optimization/m-p/3201024#M928121</guid>
      <dc:creator>mcduff</dc:creator>
      <dc:date>2015-10-07T18:53:08Z</dc:date>
    </item>
    <item>
      <title>Re: memory manager optimization</title>
      <link>https://ni.lithium.com/t5/LabVIEW/memory-manager-optimization/m-p/3201029#M928123</link>
      <description>&lt;P&gt;By the way, the reason I'm taking such a keen interest here, is that I'm reworking a 'system log engine' that runs on my RT targets and logs messages along with time and system memory/cpu statistics to a file from time to time. &amp;nbsp;The old version of the engine carried a string on a shift register that it kept bundling to until it hit a certain threshold and the string was written to file.. this would create a (noticeable) 'ramp' effect over time on memory usage on the RT targets. &amp;nbsp;Now, I'm also chasing and testing for memory leaks on these targets as they go in the field and are expected to operate 24/7 for hundreds of days. &amp;nbsp;The task of positively identifying the presence or absence of a memory leak is MUCH simpler if my code overall is 'quiet' and 'consistent' in its memory usage. &amp;nbsp;As such, most my RT code make use of pre-allocated arrays and other techniques to reduce and prevent memory allocations and de-allocations.. This makes even smaller (4 byte references anyone) leaks stand out much sooner in my testing. &amp;nbsp; This system log engine is one of the largest/last sources of 'noise' on my application memory usage. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, it is already better than the old version of this system logging loop.. now I'm just going full on OCD to make it as good as I can while I'm in there tinkering with it.. Once done, it is published on our VIPM repository so I want it as 'good as I can get it'. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Oct 2015 18:58:14 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/memory-manager-optimization/m-p/3201029#M928123</guid>
      <dc:creator>QFang</dc:creator>
      <dc:date>2015-10-07T18:58:14Z</dc:date>
    </item>
    <item>
      <title>Re: memory manager optimization</title>
      <link>https://ni.lithium.com/t5/LabVIEW/memory-manager-optimization/m-p/3201030#M928124</link>
      <description>&lt;P&gt;Mcduff, could you snag a screen shot of the Profile performance and memory result for Case 1 and Case 2? &amp;nbsp;What metric do you use to say case 1 is 'best'? (sorry if that sounds like a retarded question, I'm just curious how you made that determination of 'best'?)&lt;/P&gt;</description>
      <pubDate>Wed, 07 Oct 2015 19:00:49 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/memory-manager-optimization/m-p/3201030#M928124</guid>
      <dc:creator>QFang</dc:creator>
      <dc:date>2015-10-07T19:00:49Z</dc:date>
    </item>
    <item>
      <title>Re: memory manager optimization</title>
      <link>https://ni.lithium.com/t5/LabVIEW/memory-manager-optimization/m-p/3201032#M928126</link>
      <description>&lt;P&gt;the LabVIEW 2014 Profile Perfromance and Memory&amp;nbsp; says case 1 is using 3 MBy and the other case is using 4MBy&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That was the metric. This is on Windows, not RT.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;mcduff&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See &lt;A href="http://forums.ni.com/t5/LabVIEW/Queue-Memory-Allocation-Weirdness/m-p/1990809#M656598" target="_blank"&gt;http://forums.ni.com/t5/LabVIEW/Queue-Memory-Allocation-Weirdness/m-p/1990809#M656598&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;for strange memory probelms regarding queues&lt;/P&gt;</description>
      <pubDate>Wed, 07 Oct 2015 19:05:02 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/memory-manager-optimization/m-p/3201032#M928126</guid>
      <dc:creator>mcduff</dc:creator>
      <dc:date>2015-10-07T19:05:02Z</dc:date>
    </item>
    <item>
      <title>Re: memory manager optimization</title>
      <link>https://ni.lithium.com/t5/LabVIEW/memory-manager-optimization/m-p/3201049#M928132</link>
      <description>&lt;P&gt;Understood. &amp;nbsp;When I run the Profile Performance and Memory on the RT system, you're basically saying that I can run it one way, look at the "Max Bytes", then run it with the other code option and look at "Max Bytes" for this particular VI and compare?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My code with in-place shows Max Bytes = 72.34k, avg blocks = 25, min blocks = 25, max blocks = 26&lt;/P&gt;
&lt;P&gt;My code with array sub-set shows Max &amp;nbsp; = 88.67k, avg blocks = 27, &lt;SPAN&gt;min blocks = 27, max blocks = 27&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Re-factoring to use DVR I getMax Bytes =&amp;nbsp;9.27k, &amp;nbsp; &amp;nbsp;avg blocks = 24, &lt;SPAN&gt;min blocks = 24, max blocks = 24&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;Presumably the rest of the buffer now resides in the top level vi where the DVR is created... but for some strange reason that VI shows 0 across all tabs in the profile... 0 ram, 0 time... but I know it was running..&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;Thanks for pushing me to check the DVR wrapped version.. &amp;nbsp;looks fairly superior and as an added benefit I'm only passing a reference in and out of the 2-3 subVI's I have, instead of the array.&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>Wed, 07 Oct 2015 19:49:54 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/memory-manager-optimization/m-p/3201049#M928132</guid>
      <dc:creator>QFang</dc:creator>
      <dc:date>2015-10-07T19:49:54Z</dc:date>
    </item>
    <item>
      <title>Re: memory manager optimization</title>
      <link>https://ni.lithium.com/t5/LabVIEW/memory-manager-optimization/m-p/3201053#M928134</link>
      <description>&lt;P&gt;As a side note on weirdness and Queues, obtain Q with fixed max depth on an RT does not pre-allocate memory (or at least not last I checked, maybe fixed in 2015). &amp;nbsp;Instead you had to fill the Q to the max size.. Then, if you used 'flush' memory COULD in some instances be de-allocated... so to prevent that, the recomendation was/is to dequeue (and ignore) the queue back to 0... &amp;nbsp;Queues on RT of course is potentially a really bad idea anyway, if you are on RT for the sake of deterministic execution times anyway. &amp;nbsp;If you don't care about jitter etc., then they are still somewhat fickle, but have less CPU overhead than the RT FIFO's.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Oct 2015 19:52:40 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/memory-manager-optimization/m-p/3201053#M928134</guid>
      <dc:creator>QFang</dc:creator>
      <dc:date>2015-10-07T19:52:40Z</dc:date>
    </item>
    <item>
      <title>Re: memory manager optimization</title>
      <link>https://ni.lithium.com/t5/LabVIEW/memory-manager-optimization/m-p/3201058#M928136</link>
      <description>&lt;P&gt;&lt;FONT color="#FF0000"&gt;Understood. &amp;nbsp;When I run the Profile Performance and Memory on the RT system, you're basically saying that I can run it one way, look at the "Max Bytes", then run it with the other code option and look at "Max Bytes" for this particular VI and compare?&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have no experience with RT, only the Windows side. That being said, the Profile Performance and Memory usually gives a good indication of the memory BUT it is not always right. When I looked at the Windows Task Manager for some situations I would see a difference, I do not know if there is anything similar to the Task Manager on the RT side. So, what I guess I am saying I would optimize first with the Profile Performance and Memory then with the Task Manager if those gave me different answers. Generally, I use DVRs for large arrays. It is easier to pass around a reference than an array.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;mcduff&lt;/P&gt;</description>
      <pubDate>Wed, 07 Oct 2015 20:00:21 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/memory-manager-optimization/m-p/3201058#M928136</guid>
      <dc:creator>mcduff</dc:creator>
      <dc:date>2015-10-07T20:00:21Z</dc:date>
    </item>
    <item>
      <title>Re: memory manager optimization</title>
      <link>https://ni.lithium.com/t5/LabVIEW/memory-manager-optimization/m-p/3201068#M928140</link>
      <description>&lt;P&gt;There's a bunch of misleading information here.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First, there's no reason to use an IPE structure. LabVIEW will allocate a subarray for the array subset, which means allocating only a new starting point, array length, and stride (the gap between elements, if you were decimating or reversing the array), but pointing at the original data (NOT making a copy). For more information on subarrays, see &lt;A href="https://lavag.org/topic/7307-another-reason-why-copy-dots-is-a-bad-name-for-buffer-allocations/" target="_self"&gt;https://lavag.org/topic/7307-another-reason-why-copy-dots-is-a-bad-name-for-buffer-allocations/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Mcduff's example snippets also may not be that helpful, because the array size is constant, so the Initialize Array can get folded into an array constant. This makes sense if the array is actually constant, but if you do something that modifies the array (which could include splitting and recombining it, depending on how smart the compiler is), LabVIEW then needs to make a copy of that entire constant array, because constants are read-only. I suspect that the DVR works around this in some way, which would explain why the non-DVR case is much worse - but I would still recommend avoiding the IPE entirely here, and if you want accurate measurements, replace the array sizes with controls. See &lt;A href="https://lavag.org/topic/7063-why-does-the-replace-array-subset-double-the-used-memory/" target="_self"&gt;https://lavag.org/topic/7063-why-does-the-replace-array-subset-double-the-used-memory/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Oct 2015 20:22:01 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/memory-manager-optimization/m-p/3201068#M928140</guid>
      <dc:creator>nathand</dc:creator>
      <dc:date>2015-10-07T20:22:01Z</dc:date>
    </item>
    <item>
      <title>Re: memory manager optimization</title>
      <link>https://ni.lithium.com/t5/LabVIEW/memory-manager-optimization/m-p/3201072#M928141</link>
      <description>&lt;P&gt;Pure gold those links nathand. &amp;nbsp;THANKS!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since my buffer array is 'carried around' a bit, and is indeed of a fixed size, in general I think it might still make sense to pass the DVR reference around instead of the array... for the example shown (where I split the array and write a portion to file), I see what you mean nathand, and will re-work that portion to not use IPE. &amp;nbsp;(Where I put data into the fixed array buffer, I assume I would still be better off to use IPE's? After all, I'm specifically looking to replace big chunks of the array with new values, in-place.. seems like the text book example of when to use IPE?)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I will do some more benchmarks tomorrow to look into performance; both speed and ram use, and see if there are any big up or down sides on either of those metrics one way or the other.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks to all of you who are posting and participating!&lt;/P&gt;</description>
      <pubDate>Wed, 07 Oct 2015 20:35:27 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/memory-manager-optimization/m-p/3201072#M928141</guid>
      <dc:creator>QFang</dc:creator>
      <dc:date>2015-10-07T20:35:27Z</dc:date>
    </item>
    <item>
      <title>Re: memory manager optimization</title>
      <link>https://ni.lithium.com/t5/LabVIEW/memory-manager-optimization/m-p/3201079#M928142</link>
      <description>&lt;P&gt;You are probably correct on all accounts as usual. I believe a buffer will be allocated for the File Write part regardless of whether you use an IPE or Array Subset, the only question is if the IPE or Array Subset makes a copy. I always use the IPE becasue at one point when I rewrote the Min-Max Decimation VI there was a memory copy due to the Array subset, in the IPE there was no extra buffer. Again, I do not know what version, I can place the Min Max decimation here if anybody wants it to examine.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;mcduff&lt;/P&gt;</description>
      <pubDate>Wed, 07 Oct 2015 20:44:13 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/memory-manager-optimization/m-p/3201079#M928142</guid>
      <dc:creator>mcduff</dc:creator>
      <dc:date>2015-10-07T20:44:13Z</dc:date>
    </item>
    <item>
      <title>Re: memory manager optimization</title>
      <link>https://ni.lithium.com/t5/LabVIEW/memory-manager-optimization/m-p/3201083#M928143</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/208984"&gt;@QFang&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;(Where I put data into the fixed array buffer, I assume I would still be better off to use IPE's? After all, I'm specifically looking to replace big chunks of the array with new values, in-place.. seems like the text book example of when to use IPE?)&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I think you're attributing some magic to an IPE. The compiler already arranges code to do work in-place when it determines that's possible. There should be no advantage to doing Replace Array Subset on its own, versus splitting the array in an IPE and then substituting part of the array with the new data before recombining. In both cases, you're copying new data into a portion of the existing array.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The textbook use of an IPE is when you want to operate in-place on the &lt;EM&gt;elements&lt;/EM&gt; of the array (as shown for example in the IPE help for Array Split/Replace Subarrays). If your input to one of the subarrays originates from somewhere other than the corresponding IPE subarray outputs, then you gain nothing from the IPE, because there's nothing that can be done in-place there. The two subarrays (the existing data and the new values you want to replace them with) are both in memory at the same time, in different memory locations, and you have to copy one over the other.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Oct 2015 20:50:00 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/memory-manager-optimization/m-p/3201083#M928143</guid>
      <dc:creator>nathand</dc:creator>
      <dc:date>2015-10-07T20:50:00Z</dc:date>
    </item>
    <item>
      <title>Re: memory manager optimization</title>
      <link>https://ni.lithium.com/t5/LabVIEW/memory-manager-optimization/m-p/3201100#M928146</link>
      <description>&lt;P&gt;Nathand is correct&lt;/P&gt;
&lt;P&gt;Case A is the Best as far memory as code simplicity.&lt;/P&gt;
&lt;P&gt;Case B uses the same memory as Case A but mode code.&lt;/P&gt;
&lt;P&gt;Case C uses the most memory.&lt;/P&gt;
&lt;P&gt;(Note the delay is to monitor the memory usuage on the Windows Task Manager, Should be not more than 3 Mby which is true for A &amp;amp; B)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Case A&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://ip1.i.lithium.com/fc7eff56dbefad47d3182ea175108defb2a7d6e8/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f31373332313169324246383242344330413331453733342f696d6167652d73697a652f6f726967696e616c3f763d6d70626c2d312670783d2d31" border="0" alt="CaseA.png" title="CaseA.png" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Case B&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://ip1.i.lithium.com/803ed432d384d62c100d479467ac7511de0017e9/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f31373332313269433831364630384133393641463630362f696d6167652d73697a652f6f726967696e616c3f763d6d70626c2d312670783d2d31" border="0" alt="CaseB.png" title="CaseB.png" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Case C&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://ip1.i.lithium.com/992d3238ed547cd7ec908ba4aa48790a2090f130/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f31373332313369453841464232334445414443393233462f696d6167652d73697a652f6f726967696e616c3f763d6d70626c2d312670783d2d31" border="0" alt="CaseC.png" title="CaseC.png" /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Oct 2015 21:13:15 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/memory-manager-optimization/m-p/3201100#M928146</guid>
      <dc:creator>mcduff</dc:creator>
      <dc:date>2015-10-07T21:13:15Z</dc:date>
    </item>
    <item>
      <title>Re: memory manager optimization</title>
      <link>https://ni.lithium.com/t5/LabVIEW/memory-manager-optimization/m-p/3201115#M928150</link>
      <description>&lt;P&gt;What about the case with no DVR? I doubt the DVR makes a difference in memory use; it might slightly negatively impact performance because there's an extra level of de-referencing needed to get to the data.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Oct 2015 21:40:14 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/memory-manager-optimization/m-p/3201115#M928150</guid>
      <dc:creator>nathand</dc:creator>
      <dc:date>2015-10-07T21:40:14Z</dc:date>
    </item>
  </channel>
</rss>

