SoWesley

Trim Memory Size

Mar 15th, 2016
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 0.30 KB | None | 0 0
  1. procedure TrimAppMemorySize;
  2. var
  3.   MainHandle : THandle;
  4. begin
  5.   try
  6.     MainHandle := OpenProcess(PROCESS_ALL_ACCESS, false, GetCurrentProcessID) ;
  7.     SetProcessWorkingSetSize(MainHandle, $FFFFFFFF, $FFFFFFFF) ;
  8.     CloseHandle(MainHandle) ;
  9.   except
  10.   end;
  11.  
  12.   Application.ProcessMessages;
  13. end;
Advertisement
Add Comment
Please, Sign In to add comment