procedure TForm1.Button1Click(Sender: TObject);var pmc:PPROCESS_MEMORY_COUNTERS;begin GetMem(pmc, SizeOf(_PROCESS_MEMORY_COUNTERS)); pmc.cb:=SizeOf(_PROCESS_MEMORY_COUNTERS); If GetProcessMemoryInfo(GetCurrentProcess(), pmc, pmc.cb) then Application.MessageBox(PChar(IntToStr(pmc^.WorkingSetSize)+' Bytes'), 'Memory', MB_OK or MB_ICONINFORMATION) else Application.MessageBox('Unable to retrieve memory usage structure', 'Memory', MB_OK or MB_ICONINFORMATION); FreeMem(pmc);end;