LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Memory comparison to NT

OS: WNT, PIII, 256Mb RAM
The LabVIEW profiler reports 66 Mb memory usage and WNT reports that 220 Mb is allocate to the LabVIEW process.

How do I see where the memory is in LabVIEW?

Thank you,

Todd - nicoli@bigfoot.com
0 Kudos
Message 1 of 5
(2,968 Views)
Todd,

You can't see where memory is being used within LabVIEW, except by the profiler. Don't forget that you are using the development engine when you run the profiler, and therefore, the application (LabVIEW.exe) as well as the profiler are using memory. Additionally, LabVIEW preallocates memory. The details on this preallocation I do not have.

What are you trying to find out?
0 Kudos
Message 2 of 5
(2,968 Views)
> The LabVIEW profiler reports 66 Mb memory usage and WNT reports that
> 220 Mb is allocate to the LabVIEW process.
>
> How do I see where the memory is in LabVIEW?
>


There are several things that cause the difference. One is that there
is some memory overhead for the LV execution engine, the code, strings
in the editor, etc. These will be similar to the size of LV on launch,
somewhere around 10Mb.

Another thing that I don't believe is accounted for in the profiler is
the panels and diagrams in memory. If you have many panels open, these
will be in the LV process, but will not show up in the profiler.

Finally, processes like LV internally have what is known as a memory
heap where memory is allocated from. The OS doesn't allocate memory one
byte at a time as that would cause way too much time overhead for
something so small. Instead, the OS adds and deletes pages of memory to
a process where a page is 4k on most architectures. If a process
allocates one byte, I'm pretty sure that the OS would show 4k being
used. As the process makes additional allocations, the 4k is used up
until the OS needs to add another page. Similarly, when the process
frees up allocations, they are collected and when a page is empty it can
be given back to the OS. This means that if a single byte on a page is
still in use, then it must stay with the process.

So, what happens when a process is actively and chaotically allocating
and deallocating memory, is that the heap has reserves of available
memory scattered over multiple pages, but as far as the OS is concerned
it belongs to that process since no other process can use it.

Ideally these numbers would be closer to one another. You do not mention
which version of LV you are using, but the memory heap manager underwent
some changes for LV6.1 to be more aggressive at releasing memory to the
OS, handling multiprocessor computers better, and speeding up certain
allocation sizes. I'd hope that the numbers are closer in LV6.1.

Greg McKaskle
0 Kudos
Message 3 of 5
(2,968 Views)
Hello Greg,

I am running LabVIEW v6.0.2. Thanks for all of the information.

When I run the code "ftp.ni.com/incomming/mallocwobound.vi" and monitor memory usage I can see the discrepancy. I also can see the memory growing w/o bound if the button "delete" is depressed. WNT and the LabVIEW memmon.vi both determine are being used by LabVIEW. WNT shows the memory increasing and the memmon.vi does not.

I have tested this on two different WNT machines.

Can you duplicate the problem that I am seeing.

With the "delete" button not pressed the memory allocation is around 90 Mb and it does not grow from that point.

With the "delete" button pressed the memory that WNT shows increases w/o bound.

Can you duplicate the things that I am seein
g?

Thank you,

Todd - tgardner@newfocus.com
0 Kudos
Message 4 of 5
(2,968 Views)
The vi mallocwobound.vi was put on the ftp site on 31 Jan, 2002.

In all of these emails, I am referring to the button labelled "delete" in the center of the vi screen NOT the "delete" button on the keyboard.

I am not sure I am looking at the right place in memmon.vi but I think WNT reports 100% greater memory allocation than the memmon.vi. I am confused about this.

The memmon.vi shows the memory for that 1 vi constant with "delete" button in either position however WNT shows the memory growing without bound with the delete button set to TRUE.

Thank you,

Todd
tgardner@newfocus.com
408-284-5083
0 Kudos
Message 5 of 5
(2,968 Views)