Can memory be cleaned up?

后端 未结 7 2244
一向
一向 2020-12-04 10:41

I am working in Delphi 5 (with FastMM installed) on a Win32 project, and have recently been trying to drastically reduce the memory usage in this application. So far, I hav

7条回答
  •  余生分开走
    2020-12-04 11:32

    This is what we use in DSiWin32:

    procedure DSiTrimWorkingSet;
    var
      hProcess: THandle;
    begin
      hProcess := OpenProcess(PROCESS_SET_QUOTA, false, GetCurrentProcessId);
      try
        SetProcessWorkingSetSize(hProcess, $FFFFFFFF, $FFFFFFFF);
      finally CloseHandle(hProcess); end;
    end; { DSiTrimWorkingSet }
    

提交回复
热议问题