LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

memory

Hi,
I am monitoring the memory when my Vi is running. When my VI is running, I store some data to a database in order to see afterwards the memory progress of my VI during its execution. Well, the data I need to store is:
- Total physical memory
- Available physical memory
- Total Kernel memory
- And the memory that consumes my VI as a process in task manager.
I need to know all this data in run-time from my LabVIEW VI. Then, in run time from my LabVIEW VI and programatically, how can I know all this data? Which blocks do I need to use?

My application runs well during a few days, and afterwards it crashes, why? memory problems?

I use LV 7.0 Express.
Thanks,
ToNi.
0 Kudos
Message 1 of 9
(3,762 Views)

See also your other thread: http://forums.ni.com/ni/board/message?board.id=170&message.id=271933&jump=true

Maybe the following example code can help you:

http://zone.ni.com/devzone/cda/epd/p/id/4658

For the OS metrics, you can probably get the desired task manager statistics using .net. Here's a description how to get the CPU usage:

http://zone.ni.com/devzone/cda/tut/p/id/4888

Check your shipping example for "simple task monitor", it uses .net as described above. I am not sure if it is available in 7.0, though.

 

Message Edited by altenbach on 09-15-2007 10:49 AM

0 Kudos
Message 2 of 9
(3,742 Views)
As an alternative have you tried profiling your VI's memory usage with the built in tool?

(oops, I was typing this up while Altenbach answered in the meantime...Smiley Happy).

Message Edited by Bill@NGC on 09-15-2007 10:45 AM

0 Kudos
Message 3 of 9
(3,742 Views)
Hi Toni,
 
Most common errors or problems with memory come due to non initialized arrays or tables. As they have not a fixed predetermined size there is no memory allocation (reservation) for them. Because of that they are using new memory spaces everytime they grow in size.
 
1. Check you have initialized all the arrays in your vi.
 
A second thing can be opening and closing continously a DAQ acquisition Task or any other communication task. This is because you reserve memory for the buffers and other things and they are released when u stop/clear the task. If you open afterwards another task u are reasigning new resources using more new memory.
 
2. If u ar open/closing continously a task just avoid doing that, use one open work with a while loop and just one close afterwards.
 
Use the profile vi's tool to see how many cpu/memory is being used by the different vi's and determine which one is making crash your system.
 
hope that helps,
 
Regards,
 
Regards,

Jaime Cabrera

NI Applications Engineering Spain
0 Kudos
Message 4 of 9
(3,670 Views)
Hi,

I use a memory monitor to see how much memory uses each VI and their subvis. I found it in the examples.Where is the profile vi's tool that you say? Do you refer to the memory usage placed in the VI properties?

You are right, I continously acquire data from a PCI-6025E data acquisition device but as you say I open one time before loop and I close it afterwards. I think this is not the problem. Maybe as you say, the arrays I initialize... I'll check them again.

I use LV 7.0 Express.

Thanks in advance,

ToNi.

0 Kudos
Message 5 of 9
(3,661 Views)
Hi,
 
Try going to Tools -> Profile or Tools -> advanced -> vi's profile, it depends of your lv version 😉
 
 
Regards,

Jaime Cabrera

NI Applications Engineering Spain
0 Kudos
Message 6 of 9
(3,622 Views)
Hi,

This is place in Tools->Advanced->Profile VIs in LV7 Express but the Memory Usage checkbox appears disabled and I can't enable it to see how much memory uses each Vi.

Thanks,

ToNi.
0 Kudos
Message 7 of 9
(3,575 Views)

I am not sure if it's the same in 7.0, but right above it is a checkbox "profile memory usage" that you need to enable first. (LV 8.2.1).

Click on (1), then click on (2).

See if this helps. 🙂

 

Message Edited by altenbach on 09-21-2007 07:54 AM

0 Kudos
Message 8 of 9
(3,561 Views)
OK, thanks 😉
0 Kudos
Message 9 of 9
(3,519 Views)