The latest fastmm version provides Chinese language packs for ease of use in China. Is
Http://sourceforge.net/projects/fastmm/
Configuration File: fastmm4options. Inc,
The detailed configuration method is as follows:
{
Fast Memory Manager: Option configuration file
Set the default options for fastmm
Fastmm 4.84
}
{
Simplified Chinese translation by qianyuan Wang
Contact me if you find any improper translation.
Please contact me if there is anything inappropriate in the translation.
E-mail: wqyfavor@163.com
}
{
Translation of various compilation options (no Glossary)
Align16bytes is 16 bytes aligned
Usecustomfixedsizemoveroutines use fixed-size memory movement function
Usecustomvariablesizemoveroutines uses a variable-size memory movement function
Assumemultithreaded multi-thread processing
When the neversleeponthreadcontention thread conflicts, the process is not paused.
Installonlyifrunninginide only loads the Memory Manager in the Delphi Development Environment
Neveruninstall does not uninstall fastmm
Useruntimepackages use the runtime package
Nodebuginfo has no debugging information
Nomessageboxes does not display information
Useoutputdebugstring use Windows API outputdebugstring
Asmversion assembly version
Checkheapforuption detection heap Error
Detectmmoperationsafteruninstall
Fulldebugmode full debugging mode
Rawstacktraces full stack Tracing
Catchuseoffreedinterfaces captures references to destroyed objects
Logerrorstofile records errors to files
Logmemoryleakdetailtofile records Memory leakage details to files
Clear log files when clearlogfileonstartup is started
Loaddebugdlldynamically dynamic loading and debugging DLL
Alwaysallocatetopdown total allocation of memory from the top
Enablememoryleakreporting allows memory leak reports
Hideexpectedleaksregisteredbypointer hides possible memory leaks recorded by pointers.
Requireidepresenceforleakreporting reports leakage only when the IDE exists
Requiredebuggerpresenceforleakreporting reports leakage only when the debugger exists
Requiredebuginfoforleakreporting leakage report debugging information
Manualleakreportingcontrol manually controls the leak report
Hidememoryleakhintmessage hides Memory leakage Information
Enablemmx allows MMX
Forcemmx enforces MMX
Sharemm Shared Memory Manager
Sharemmiflibrary allows sharing the Memory Manager in the DLL
Attempttousesharedmm tries to share the Memory Manager
Enablebackwardcompatiblemmsharing allows backward compatible memory manager sharing
Fulldebugmodeinide fully debugs In the Delphi Development Environment
}
{--------------------------- Comprehensive options -----------------------------}
{Enabling this option will align all memory blocks in 16 bytes so that the SSE command can be used safely. If this option is disabled
The minimum memory block is aligned in 8 bytes, which reduces memory usage. Whether or not this option is enabled, medium and large
The storage block is aligned in 16 bytes .}
{. $ Define align16bytes}
{Allows faster fixed-size memory moving functions when a small memory block is increased. Because these functions are designed to move fixed sizes
Memory, so the efficiency is significantly higher than the memory moving function in Borland's RTL. This option can be used with the fastmove library.
To achieve higher efficiency .}
{$ Define usecustomfixedsizemoveroutines}
{Enable this option to use optimized functions to move memory blocks of any size. Disabled when fastmove function of fastcode is used
This option. The fastmove Code enables the entire program to use faster memory mobility functions, not just memory management.
. Therefore, we recommend that you combine fastmm and fastmove code and disable this option .}
{$ Define usemvmvariablesizemoveroutines}
{When enabled, the default program is multi-threaded, but the speed of a Single-threaded program is significantly reduced. It may not be set correctly during use
Enable this option when setting the ismultithread variable to a third-party multi-threaded tool. In a single-threaded main program and multi-threaded DLL
The shared memory manager must also be enabled .}
{. $ Define assumemultithreaded}
{Enabling this option will not suspend a thread in case of thread conflict. When the number of active processes is lower than or equal to the number of CPU cores
This will increase the speed. When this function is enabled, a thread enters the "wait" loop instead of handing over the time slice .}
{. $ Define neversleeponthreadcontention}
{Enabling this option will enable fastmm to be used as the memory manager only when the program runs in Delphi ide. When you want to publish
EXE is your debug EXE, but you only want to enable this option when debugging is used on the Development host. When enabled, the program does not
Run on the Development host. It uses the default Delphi Memory Manager (fulldebugmode is disabled after delphi2006.
Fastmm )}
{. $ Installonlyifrunninginide}
{Because QC #14070 (Delphi tries to release the memory after the borlandmm. dll command is disabled), when fastmm is used
As a replacement of borlandmm. dll at the core, fastmm cannot be uninstalled normally. Enabling this option will not uninstall the Memory Manager
Avoid this error .}
{. $ Define neveruninstall}
{If a runtime package is used in the current project, you need to enable this option. Assumemultithreaded is automatically enabled.
Note that you must ensure that fastmm is uninstalled after all pointers are released. If you do not do this, it will generate a huge number of A/V
Large Memory leakage reports. (Refer to the FAQ) You must start this option and the neveruninstall option at the same time .}
{. $ Define useruntimepackages}
{----------------------------- Debugging options -------------------------------}
{Enabling this option will not generate debugging code for the fastmm4.pas unit, but will also prevent the debugger from entering the fastmm4.pas unit}
{. $ Define nodebuginfo}
{Enabling the following options will not display any information, which is useful in non-stop server programs}
{. $ Define nomessageboxes}
{If you want to use Windows API outputdebugstring to display debugging information, enable the following options}
{. $ Define useoutputdebugstring}
{Enabling this option will use the fastmm of the assembly language version, which is faster than the Pascal version. Disable this option only during debugging.
Enabling checkheapforcorruption will automatically disable this setting}
{$ Define asmversion}
{Fastmm always captures bad operations in the same memory region released twice. It can also detect heap errors (usually caused
In the program ). These checks are time-consuming, so this option should be used only for debugging. If this option
Enabled. asmversion is automatically disabled}
{. $ Define checkheapforsponuption}
{Enabling this option will detect the reference operation on fastmm after fastmm has been detached. When fastmm is uninstalled,
The previous memory manager will not be restarted. Instead, it is assumed that there is a memory manager, and once there is a memory operation
Throw an error. This will capture the error that the program still performs memory operations when fastmm has been uninstalled .}
{$ Define detectmmoperationsafteruninstall}
{Set the following options to extensively detect memory leaks. All memory blocks will be configured with the first part and the tracker to verify the heap.
Integrity. The released memory blocks (pointers) are also cleared to prevent them from being used again. This option will be greatly reduced
Low memory operation speed. It is used only when debugging a program that will read and write memory out of bounds or reuse the released pointer.
Enabling this option will automatically enable checkheapforuption and automatically disable asmversion. Tip: When Enabled
This option requires the program to use the fastmm_fulldebugmode.dll file. If this file is lost, the program cannot be started .}
{$ Define fulldebugmode}
{Enable this option for full stack tracing: Check all stack entries to find valid return addresses. Note that
The primary stack frame method is much slower, but more thorough. This option is valid only when fulldebugmode is enabled .}
{$ Define rawstacktraces}
{Enabling this option will detect references to destroyed objects in the program. Note that this will make the released and modified (the content is
The memory block cannot be detected (the two cannot coexist ). This option is valid only when fulldebugmode is enabled .}
{. $ Define catchuseoffreedinterfaces}
{Enable this option to record all errors to a text file in the same directory as the program. Memory Allocation Error (when enabled
Fulldebugmode) will be added to this log. This option is invalid if fulldebugmode is disabled}
{$ Define logerrorstofile}
{Enabling this option will record all text files leaked to the same directory as the program. Memory leakage report (when enabled
Fulldebugmode) will be added to this log. If "logerrorstofile" and "fulldebugmode" are not enabled
Enabling this option is invalid. Note that all leaks are recorded, even those identified by addexpectedmemoryleaks.
Possible Memory leakage. Possible leaks caused by pointers may be caused by hideexpectedleaks-
Registeredbypointer is not displayed .}
{$ Define logmemoryleakdetailtofile}
{Delete the log file when the program starts. Invalid when logerrorstofile is not enabled}
{. $ Define clearlogfileonstartup}
{Whether to dynamically link fastmm_fulldebugmode.dll. If the DLL cannot be found, stack tracing cannot be performed. Note:
An error may occur when the order of DLL uninstallation changes in the shared memory manager .}
{. $ Define loaddebugdlldynamically}
{Fastmm usually uses the top available address to allocate large memory blocks, while the top available address is allocated
Medium and small memory blocks (this reduces fragmentation to a certain extent ). Enabling this option will give top priority to memory allocation
Available address. If the process uses a memory larger than 2 GB and the algorithm has a bad pointer allocation, select
Will help to detect errors as soon as possible}
{$ Define alwaysallocatetopdown}
{--------------------------- Memory Leak report -----------------------------}
{Enable this option to allow Memory Leak reports, which can be used in combination with the following two options .}
{$ Define enablememoryleakreporting}
{Enabling the following options will not display and record possible memory leaks caused by pointer types. Caused by class (pointer)
The possible memory leaks are often unclear, so these leaks will always be recorded in the log (in fulldebugmode
When it is enabled with logmemoryleakdetailtofile) and will be displayed when there are more leaks than expected .}
{$ Define hideexpectedleaksregisteredbypointer}
{Enable the following options to report Memory leakage only when Delphi exists on the host. When "enablememoryleakreporting"
This option is invalid when it is disabled .}
{. $ Define requireidepresenceforleakreporting}
{Enable the following options to report Memory leakage only when debugging a program in Delphi. When "enablememoryleakreporting"
This option is invalid when it is disabled. This option is only valid when debugging the EXE project and does not support DLL}
{$ Define requiredebuggerpresenceforleakreporting}
{Enable the following options to detect leakage only when the compiled unit has a debug indicator ($ D. When
This option is invalid when "enablememoryleakreporting" is disabled .}
{. $ Define requiredebuginfoforleakreporting}
{Enable this option to manually Control Memory Leak reports. When enabled, reportmemoryleaksonshutdown (Program
When the function is disabled, the memory leakage is reported. If the function is disabled by default, the system selects whether to generate a report. Other leak detection options when enabled
You must also set it correctly to perform detection}
{. $ Define manualleakreportingcontrol}
{Enable the following option to show no prompts for Memory leakage information}
{. $ Define hidememoryleakhintmessage}
{-------------------------- Instruction Set ----------------------------}
{Enable the following options to use the MMX instruction set. Disabling this option will cause a slight reduction in performance, but it will work with AMD K5,
Early processors such as Pentium I are compatible. Currently, the MMX command is only used for variable-size memory movement.
If usecustomvariablesizemoveroutines is disabled, this option is invalid .}
{. $ Define enablemmx}
{Enable the following options to forcibly use the MMX instruction set, regardless of whether the CPU supports it or not. If this option is disabled,
Check whether the CPU supports the MMX command first. It is invalid when enabledmmx is disabled .}
{$ Define forcemmx}
{----------------------- Shared Memory Manager settings ------------------------}
{Shared Memory Manager is allowed between the main program compiled by fastmm and the DLL. You can pass
Dynamic Array and long string. You need to enable attempttousesharedmm during DLL compilation to truly achieve Memory Sharing.
Note: If the main program is single-threaded and the DLL is multi-threaded, you must enable ismultithread in the main program; otherwise
The program crashes when a thread conflict occurs. Note that the static link DLL will be initialized before the main program, so the main program will actually
DLL Shared Memory Manager.
}
{. $ Define sharemm}
{Allow DLL-to-DLL sharing (or static link between DLL-to-Main Program), and use fastmm for compilation.
When using dynamic-link DLL, note that if the DLL is detached and other DLL is still sharing the memory manager
The sequence will crash. This option is only related to the dll library and must be enabled for sharemm and attempttousesharedmm. Note:
If the DLL is statically linked, it will be initialized before the main program, but the main program shares the manager with them. When
This option is invalid when sharemm is disabled}
{. $ Define sharemmiflibrary}
{If the following option is enabled, the system will try to share memory management between the main program and the DLL jointly compiled with it (this option is also enabled ).
. When sharing, the leakage caused by the user sharing will not be cleared automatically. Because the static link DLL is in the main program
Previously initialized, so set sharing options as needed}
{. $ Define attempttousesharedmm}
{Enable the following compilation options to ensure backward compatibility of the Memory Manager. For delphi2006, delphi2007, and earlier versions
Valid for fastmm}
{$ Define enablebackwardcompatiblemmsharing}
{-------------------------------- Combination setting ------------------------------}
{Enabling this option will activate fulldebugmode, installonlyifrunninginide, and loaddebugdlldynamically.
If the program is being debugged and run in Delphi, fastmm will perform full debugging (enable fulldebugmode). Otherwise
Use the default Memory Manager (fastmm with fulldebugmode disabled after delphi2006 ).}
{. $ Define fulldebugmodeinide}
{Quick configuration release and debugging version}
{$ Ifdef release}
{Set the release version}
{. $ UNDEF fulldebugmode}
{. $ UNDEF checkheapforsponuption}
{. $ Define asmversion}
{. $ UNDEF enablememoryleakreporting}
{. $ UNDEF useoutputdebugstring}
{$ Else}
{Set high version}
{. $ Define fulldebugmode}
{. $ Define enablememoryleakreporting}
{. $ Define useoutputdebugstring}
{$ Endif}
{-------------------- Borlndmm. dll compilation options ---------------------}
{If you are re-compiling the borlandmm. dll file, set the following options as needed}
{Enable this option when compiling borlandmm. dll}
{. $ Define borlndmmdll}
{Enable this option if the DLL is used by Delphi}
{. $ Define dllforide}
{Enable this option when compiling and debugging DLL files}
{. $ Define debugdll}
{Do not change the following content}
{$ Ifdef borlndmmdll}
{$ Define assumemultithreaded}
{$ UNDEF hideexpectedleaksregisteredbypointer}
{$ UNDEF requiredebuggerpresenceforleakreporting}
{$ UNDEF requiredebuginfoforleakreporting}
{$ Define detectmmoperationsafteruninstall}
{$ UNDEF manualleakreportingcontrol}
{$ UNDEF sharemm}
{$ UNDEF attempttousesharedmm}
{$ Ifdef dllforide}
{$ Define neveruninstall}
{$ Define hidememoryleakhintmessage}
{$ UNDEF requireidepresenceforleakreporting}
{$ Ifndef debugdll}
{$ UNDEF enablememoryleakreporting}
{$ Endif}
{$ Else}
{$ Define enablememoryleakreporting}
{$ UNDEF neveruninstall}
{$ UNDEF hidememoryleakhintmessage}
{$ Define requireidepresenceforleakreporting}
{$ Endif}
{$ Ifdef debugdll}
{$ Define fulldebugmode}
{$ Define rawstacktraces}
{$ UNDEF catchuseoffreedinterfaces}
{$ Define logerrorstofile}
{$ Define logmemoryleakdetailtofile}
{$ UNDEF clearlogfileonstartup}
{$ Else}
{$ UNDEF fulldebugmode}
{$ Endif}
{$ Endif}
{Put BCB settings here. When the "build with dynamic RTL" option is enabled,
Cb2006/cb2007 can compile borlandmm. DLL files to track memory leaks .}
{------------------------------ Specifically set for BCB ----------------------------}
{To enable the patch for BCB, you need to go to "project options-> PASCAL/Delphi compiler-> defines"
To add the definition of BCB. (Thanks to Jiyuan Xie for implementing this part )}
{$ Ifdef BCB}
{$ Ifdef checkheapforsponuption}
{$ Define patchbcbterminate}
{$ Else}
{$ Ifdef detectmmoperationsafteruninstall}
{$ Define patchbcbterminate}
{$ Else}
{$ Ifdef enablememoryleakreporting}
{$ Define patchbcbterminate}
{$ Endif}
{$ Endif}
{$ Endif}
{$ Ifdef patchbcbterminate}
{$ Define checkcppobjecttype}
{$ UNDEF checkcppobjecttypeenabled}
{$ Ifdef checkcppobjecttype}
{$ Define checkcppobjecttypeenabled}
{$ Endif}
{If neither "checkheapforcorruption" nor "enablememoryleakreporting" is enabled, disable
"Checkcppobjecttypeenabled "}
{$ Ifdef checkheapforsponuption}
{$ Else}
{$ Ifdef enablememoryleakreporting}
{$ Else}
{$ UNDEF checkcppobjecttypeenabled}
{$ Endif}
{$ Endif}
{$ Endif}
{$ Endif}