LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

programmatically monitoring Windows memory

Solved!
Go to solution

Hi

I'd like to monitor the total amount of memory a Windows-process is using. Something like the Windows Task Manager does.

 

This is primarially used to get the amount of memory an application built with Labview is using.

I know there are several ways to calculate the memory of certain VIs and iterate through all Vis in memory, but that doesn't the trick.

You'll miss out the memory that is consumed in a DLL. This is run in the same address space as the VI, but is not logged in any of the common LV monitoring tools.

 

In my case I wan't to restart an application when the LV 8.6 Webserver eats too much memory, which it does if you plublish heavily decorated frontpanels.

 

So I am sure there is way to get these numbers in a Windows Kernel or User method or property. Is someone better in MS internals than I? Then I'd really appreciate a hint.

Gabi

7.1 -- 2013
CLA
0 Kudos
Message 1 of 4
(5,725 Views)
Solution
Accepted by topic author GabbyG

Use .net constructs to perform this.

 

Under Help >> Find Examples:  search for ".net" then select "SimpleTaskMonitor. Once you understand this VI open the Get Process.vi.  Add a property under Process name and you can expose more properties including many memory usage properties.

 

GetProcesses

   List ProcessNames

      Find "your process"

          Get "your process" reference

             use a property to get the needed memory usage.

Visualize the Solution

CLA

LabVIEW, LabVIEW FPGA
Message 2 of 4
(5,706 Views)

You can also use the System Monitor ActiveX control. http://forums.ni.com/t5/LabVIEW/System-monitor-counter/m-p/359512#M182538

0 Kudos
Message 3 of 4
(5,688 Views)

Thanks guys

 

I usually stick with Active-X but this time I could not follow the MS-sequence of methods and properties ;). Maybe it's also because I tried it on a German XP-Professional (SP3).

 Ultimatly the scan will have to run as well on a Windows-Server 2008/64 So I decided to go with .net.

 

I didn't even know there existed an example for that. But since my problem was "monitoring memory" I would not search for System Monitor or Counters.

 

So thank again.

 

Gabi

 

BTW: As compared to what google brings up for a search, NI is pretty poor.

 

7.1 -- 2013
CLA
0 Kudos
Message 4 of 4
(5,663 Views)