Need a function that reads commit charge.

May 4, 2011 at 06:00:53
Specs: Windows XP
Within an HP VEE program I need to monitor commit charge.
HP VEE has memory leak problems, and if we don't keep an eye on the commit charge our test code will crash. Is there something like a .NET function that can be called to read this value?

See More: Need a function that reads commit charge.

Report •

May 4, 2011 at 07:30:44
If you want to monitor it, you'd use System.Diagnostics.PerformanceCounter. (Example)

You could also use WMI if you wanted to go the scripting route:

panicAt = 2 ^ 19   '0.5 GB
With GetObject("winmgmts:").InstancesOf("Win32_OperatingSystem").ItemIndex(0)
  Do While True
    fvm = CDbl(.FreeVirtualMemory)
    If (fvm <= panicAt And Not panicing) Then _
      CreateObject("WScript.Shell").Popup "Running low on memory", 0, "", &H1010
    panicing = fvm <= panicAt
    WScript.Sleep 5000 'Poll every 5 seconds
End With

How To Ask Questions The Smart Way

Report •

May 4, 2011 at 07:43:36
Thanks for the fast and extremely helpful reply!

Report •

Related Solutions

Ask Question