Function GetProcessMemoryUsage
;/
function# pid
;Returns process memory usage, KB.
;It is what you see in Task Manager, "Commit Size" column. Or in Process Hacker, "Private bytes" column.
;pid - process id. See <help>ProcessNameToId</help>, <google>GetWindowThreadProcessId</google>.
__Handle hp=OpenProcess(PROCESS_QUERY_LIMITED_INFORMATION|PROCESS_VM_READ 0 pid)
if(hp=0) end ES_FAILED 16
PROCESS_MEMORY_COUNTERS z.cb=sizeof(z)
if GetProcessMemoryInfo(hp &z sizeof(z))
,ret z.PagefileUsage/1024