Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- uses {MML}StringUtil;
- (*
- Returns (resident) memory usage of a process in kB.
- *)
- function GetProcessMem(proc:UInt32): UInt64;
- var
- list: TStringList;
- begin
- Result := 0;
- list := TStringList.Create;
- try
- list.NameValueSeparator:=':';
- list.LoadFromFile( Format('/proc/%d/status', [proc]) );
- Result := StrToInt64( ExtractFromStr(list.Values['VmRSS'], NUMBERS) );
- finally
- list.Free();
- end;
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement