Delphi7下使用FastMM4

1> 将文件Replacement BorlndMM DLL/Precompiled/for Delphi IDE/Performance/BorlndMM.dll,替换掉Delphi/Bin下的相应文件,完成对IDE的提速;

2> 设置路径:Enviroment->Library->Directories-> Library Path 添加FassMM路径(在Delphi安装目录下建立FastMM文件夹,“C:\Program Files\Borland\Delphi7\FastMM”,将FastMM4.pas、FastMM4Messages.pas、FastMM4Options.inc三个文件拷贝其中,添加库路径"$(DELPHI)/FastMM;");

3> 在项目文件中(Project->View Source打开),uses 后第一行添加FastMM4单元;

  例如:

    FastMM4,

    Main in ‘Main.pas’ {MainForm},

    ......

4> 修改FastMM4Options.inc:

  (1) 打开全调试模式,例:

    {$define FullDebugMode}

  (2) 把FastMM_FullDebugMode.dll拷贝到编译后生成的可执行程序所在目录。

  (3) 打开内存泄漏报告:EnableMemoryLeakReporting(一般情况下是缺省打开的)。

  这样就打开了全调试模式,如果发生内存泄漏将会生成报告文件。如果在IDE运行的时候还会弹出一个对话框显示。报告文件类似:XXX_MemoryManager_EventLog.txt 。

5> 编译运行你的程序,如果有Memory leak,在关闭程序时会有一个提示对话框。