Search every day: Take the application 11M memory, drop to 500K!

xiaoxiao2021-03-06  44

The following procedure is placed in a Timer, executed every time, such as 5 seconds.

{

*******************************************

* CLEAR MEMORY

* From muse2008

*******************************************

}

PROCEDURE CLEARMEMORY;

Begin

IF Win32Platform = VER_PLATFORM_WIN32_NT THEN

Begin

SetProcessWorkingsetSize (GetCurrentProcess, $ ffffff, $ ffffff);

Application.ProcessMESSAGES;

END;

END;

Do the memory occupied by the process is exchanged.

Memory is saved, but it will be loaded frequently.

May affect program operation efficiency

转载请注明原文地址:https://www.9cbs.com/read-80211.html

New Post(0)