function TProcessMemory.GetValue: integer; var pmc: PPROCESS_MEMORY_COUNTERS; i: integer; begin result:=0; i:=SizeOf(_PROCESS_MEMORY_COUNTERS); GetMem(pmc, i); pmc^.cb:=i; if GetProcessMemoryInfo(GetCurrentProcess(), pmc, i) then begin result:=pmc^.WorkingSetSize; end; FreeMem(pmc); end;