Matthew VanDerlofske Posted February 13, 2006 Share Posted February 13, 2006 How can a gather the current memory usage of a process? Link to comment Share on other sites More sharing options...
pecloe Posted February 13, 2006 Share Posted February 13, 2006 ctrl-alt-delete but i'll bet thats not what your looking for. Link to comment Share on other sites More sharing options...
Matthew VanDerlofske Posted February 14, 2006 Author Share Posted February 14, 2006 No Not really, I want to log the memory usage of a process every few minutes. Link to comment Share on other sites More sharing options...
ChrisL Posted February 15, 2006 Share Posted February 15, 2006 You could probably adapt this created with Scriptomatic, you'll need the beta version of AutoIT and probably have to loop through until you find the process your looking for, It looks like it has the virtual size paged size and working size etc. expandcollapse popup$wbemFlagReturnImmediately = 0x10 $wbemFlagForwardOnly = 0x20 $colItems = "" $strComputer = "localhost" $Output="" $Output = $Output & "Computer: " & $strComputer & @CRLF $Output = $Output & "==========================================" & @CRLF $objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\CIMV2") $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_Process", "WQL", _ $wbemFlagReturnImmediately + $wbemFlagForwardOnly) If IsObj($colItems) then For $objItem In $colItems $Output = $Output & "Name: " & $objItem.Name & @CRLF $Output = $Output & "PageFileUsage: " & $objItem.PageFileUsage & @CRLF $Output = $Output & "PeakPageFileUsage: " & $objItem.PeakPageFileUsage & @CRLF $Output = $Output & "PeakVirtualSize: " & $objItem.PeakVirtualSize & @CRLF $Output = $Output & "PeakWorkingSetSize: " & $objItem.PeakWorkingSetSize & @CRLF $Output = $Output & "Priority: " & $objItem.Priority & @CRLF $Output = $Output & "PrivatePageCount: " & $objItem.PrivatePageCount & @CRLF $Output = $Output & "ProcessId: " & $objItem.ProcessId & @CRLF $Output = $Output & "QuotaNonPagedPoolUsage: " & $objItem.QuotaNonPagedPoolUsage & @CRLF $Output = $Output & "QuotaPagedPoolUsage: " & $objItem.QuotaPagedPoolUsage & @CRLF $Output = $Output & "QuotaPeakNonPagedPoolUsage: " & $objItem.QuotaPeakNonPagedPoolUsage & @CRLF $Output = $Output & "QuotaPeakPagedPoolUsage: " & $objItem.QuotaPeakPagedPoolUsage & @CRLF $Output = $Output & "WorkingSetSize: " & $objItem.WorkingSetSize & @CRLF if Msgbox(1,"WMI Output",$Output) = 2 then ExitLoop $Output="" Next Else Msgbox(0,"WMI Output","No WMI Objects Found for class: " & "Win32_Process" ) Endif Func WMIDateStringToDate($dtmDate) Return (StringMid($dtmDate, 5, 2) & "/" & _ StringMid($dtmDate, 7, 2) & "/" & StringLeft($dtmDate, 4) _ & " " & StringMid($dtmDate, 9, 2) & ":" & StringMid($dtmDate, 11, 2) & ":" & StringMid($dtmDate,13, 2)) EndFunc [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
Confuzzled Posted February 16, 2006 Share Posted February 16, 2006 Doesn't the Windows Performance Monitor have logging facilities?See http://www.windowsnetworking.com/j_helmig/wxpperfm.htm Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now