04-07-2012 10:20 AM
Hello,
I'm building an application with many sub VI's. This application is reading data from DAQ. When user hits Start button sub vi starts and, using software triggering, waits for valid peak. After peak is detected reads some more data (how much is user dependent- user configures before). If peak is not detected reads constantly data and stores it in a queue using lossy enqueue element.
Any time I hit Start the memory usage increases about 25MB.
Every time user hits Start, one sub vi obtains Queues (2, one for history data, before peak and one for data after peak is detected), these queues are passed to another vi that builds one array of data from both queues and destroys queues.
How to find where this memory disappears?
I added Execution Trace that contains events from 3 hits of start button.
Thank you,
Przemek
04-07-2012 11:35 AM - edited 04-07-2012 11:40 AM
This is impossible to tell by looking a picture.
04-07-2012 02:16 PM
The main vi looks like that:
the sizes of the queues are variable. I tested when max queue size set to 10 (10 2D arrays 40k samples DBL in every array). The vi that obtains queue:
The 2D arrays contains all the elements from both queues, so if queue contains 10 elements each 40kS the array is 4 rows x 400 k:
I hope it will help.
Thank you for reply.
Przemek
04-07-2012 02:18 PM
Are you looking for where LabVIEW allocates the memory, or deallocates it?
LabVIEW is a little funky with deallocating memory. Once the memory is no longer needed by the program LabVIEW will deallocate it . . . whenever LabVIEW finds it convenient. That's why DVR's were created, to be able to create explicit lifetimes for data.
04-21-2012
02:34 PM
- last edited on
03-12-2025
09:42 AM
by
Content Cleaner
Hello Przemek.
I suggest you to use some additional tools that will show you what is happening with memory of your VI.
Firstly, you can read about vi memory usage here: https://www.ni.com/docs/en-US/bundle/labview/page/vi-memory-usage.html .
To see where on your block diagram LV allocates memory use Show Buffer Allocations Window (you can read about this tool here https://www.ni.com/docs/en-US/bundle/labview-api-ref/page/project/showinplace.html).
Also try to use Profile Performance and memory Window (https://www.ni.com/docs/en-US/bundle/labview-api-ref/page/dialog-boxes/profile-performance-and-memor...
Use those tools as starting point and try to figure out what part of code is causing to have behavior you are interested in.It is a little bit hard to debug application from print screens. Also, I think that you should a little bit better describe what are sub-vis in your main vi (e.g. what rest of block diagram prints screens exactly present).It would be better to have vis, but as you mention your application is quite a big and that is probably why you did not post vis. If you can extract part of your application that replicate behavior you are interested in, it can be usefull for us who are trying to assist you. Did you try to use those tools that I mention?
Best regards,
S.P.