Recently in writing a backdoor program, inadvertently see such a piece of code, tried, and sure enough effective. The original program consumes more than 5M of memory, and sure enough to 600K, but expect the code execution efficiency may be reduced, because the original pre-allocated memory space may become dynamic, but for my program speed is not a problem.
From http://www.cn-doc.com/_soft_delphi_tech_doc/2005_08_18_01/20050818012858312.htm
have not written blog for many days, recently solved a problem-reduce memory consumption. However, this method can only be applied in winxp,win2k and does not show the best program that the main form has been running. The previous program consumes 11m of memory, I can only reduce the method of dynamically creating Windows to 100k, after applying this method memory occupies only 496k. Put the following procedure in a timer, once every time, such as 5 seconds.
{
************************************
* Clear Memory
* from muse2008
****************************
}
procedure clearmemory;
Begin
If win32platform = Ver_platform_win32_nt then
begin
setprocessworkingsetsize (getcurrentprocess, $FFFFFFFF, $FFFFFFFF);
Application.processmessages;
end;
End;