ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Tracking Memory Usage with .NET Processes

Solved!
Go to solution

Hi All,

I would like to track my application's memory usage over time, so I am using the .NET process functions to do so, however I have noticed that the Process.VirtualMemorySize, Process.PrivateMemorySize, Process.PagedMemorySize, and Process.WorkingSet64 (and non 64) all will return the same value on every call. I have attached a little vi that demonstrates the issue, and a built version. I build up a large array to increase the memory usage, and can see the increase in memory usage in the task manager when I build the array, however it is not reflected in the .NET function calls. However, if I close the references and reopen them, then call them again, the values will update. Anyone know why this is? Is there another method I need to be calling to refresh the data?

0 Kudos
Message 1 of 3
(3,291 Views)
Solution
Accepted by topic author paul.r

Calling the Process.Refresh method seems to fix the problem.

0 Kudos
Message 2 of 3
(3,270 Views)

@paul.r wrote:

Calling the Process.Refresh method seems to fix the problem.

 


this Process.Refresh method fixed my problem

 

Thanks

Niki

zip code look up

 

0 Kudos
Message 3 of 3
(2,410 Views)