频道分类

Delphi 调整应用程序内存大小

作者:admin 来源: 日期:2019/10/31 22:32:19 人气: 标签:

 
procedure TForm1.Button1Click(Sender: TObject);
var
  MainHandle : THandle;
begin
  try
    MainHandle := OpenProcess(PROCESS_ALL_ACCESS, false, GetCurrentProcessID) ;
    SetProcessWorkingSetSize(MainHandle, $FFFFFFFF, $FFFFFFFF) ;
    CloseHandle(MainHandle) ;
    //Log('清理内存成功!');
  except
    //Log('无法清理内存!');
  end;
  Application.ProcessMessages;
end;