They all report zero memory, for any/all processes.
Primarily, I'm interested in the amount of memory in use by the script I'm working on.
This one, by Senenity: https://autohotkey.com/board/topic/3320 ... ntry210784
Msgbox % GetProcessMemoryInfo( "chrome.exe" ) ==> zero!?
Or this one: (sorry, forgot where I got it, so can't credit the author)
Code: Select all
GetProcessMemory_All(ProcName)
{
Process, Exist, %ProcName%
pid := Errorlevel
; get process handle
hProcess := DllCall( "OpenProcess", UInt, 0x10|0x400, Int, false, UInt, pid )
; get memory info
PROCESS_MEMORY_COUNTERS_EX := VarSetCapacity(memCounters, 44, 0)
DllCall( "psapi.dll\GetProcessMemoryInfo", UInt, hProcess, UInt, &memCounters, UInt, PROCESS_MEMORY_COUNTERS_EX )
DllCall( "CloseHandle", UInt, hProcess )
list := "cb,PageFaultCount,PeakWorkingSetSize,WorkingSetSize,QuotaPeakPagedPoolUsage"
. ",QuotaPagedPoolUsage,QuotaPeakNonPagedPoolUsage,QuotaNonPagedPoolUsage"
. ",PagefileUsage,PeakPagefileUsage,PrivateUsage"
n := 0
Loop, Parse, list, `,
{
n += 4
SetFormat, Float, 0.0 ; round up K
this := A_Loopfield
this := NumGet( memCounters, (A_Index = 1 ? 0 : n-4), "UInt") / 1024
; omit cb
If A_Index != 1
info .= A_Loopfield . ": " . this . " K" . ( A_Loopfield != "" ? "`n" : "" )
}
Return "[" . pid . "] " . pname . "`n`n" . info ; for everything
}