uses psApi;
function ProcessBytes: Cardinal;
var
pmc: PPROCESS_MEMORY_COUNTERS;
cb: Integer;
begin
cb := SizeOf(TProcessMemoryCounters);
GetMem(pmc, cb);
pmc^.cb := cb;
if GetProcessMemoryInfo(GetCurrentProcess, pmc, cb)
then result := pmc^.WorkingSetSize
else result := 0;
FreeMem(pmc);
end;
// Beispielaufruf
procedure TForm1.Button1Click(Sender: TObject);
var
c: Cardinal;
begin
c := ProcessBytes;
if c = 0 then
ShowMessage('Process-Info nicht ermittelbar.')
else ShowMessage(FormatFloat('#,##0 Bytes', c));
end;