清理内存

procedure TfrmMain.ClearMemory; {释放内存}
begin
  if Win32Platform = VER_PLATFORM_WIN32_NT then
  begin
    SetProcessWorkingSetSize(GetCurrentProcess, $FFFFFFFF, $FFFFFFFF);
    Application.ProcessMessages;
  end;
end;
原文地址:https://www.cnblogs.com/760044827qq/p/4205193.html