Simply Memory Manager (SMM) is free and open source software to replace the native memory manager for Free Pascal and Lazarus projects on Windows.
Download Memory Manager
The latest stable release is SimplyMM-2.2
Download Memory Manager
Please consider a
donation to keep the project going.
Feel free to
ask a question or report an issue.
SMM is an open source software; you can use it or redistribute under the terms of the End-User License Agreement.
How to use
Place the SMM unit the first in the
uses statement.
uses
SimplyMM,
....
SMM and memory leaks tracing
Do not use the SMM when heap trace manager (HeapTrc) is active. In such cases, exclude the SMM unit from the
uses statement.
uses
// SimplyMM,
....
Why Simply Memory Manager?
Benefits
-
It prevents the out of memory error that occurs in the native Free Pascal memory manager on Windows when cyclically allocating and freeing large amounts of memory.
-
It is faster on avalanche-like memory allocation requests.
-
It has a reserved memory feature to prevent a real out of memory situation.
In some cases, it is necessary to repeatedly get and free a large amount of memory.
For example, it can be editing graphic files, copying a large number of files and, of course, simulation large and complex systems.
In the latter case, multiple reuse of the maximum amount of available memory is required.
Free Pascal's native memory manager uses certain memory allocation and deallocation functions for 32-bit Windows applications that cause fatal errors when reusing large amounts of memory repeatedly.
In addition, it runs in this case rather slowly.
SMM prevents such errors by using a different approach, and it is much faster on avalanche-like memory allocation requests.
SMM demonstrates enough good performance both for single- and multi-thread tasks but in some cases, SMM may be a bit slower than the native memory manager.
This is due to the fact that when using Lazarus IDE, some memory blocks were already allocated, even when the SMM was the first unit in the "uses" statement.
Therefore, the SMM must also recognize and process requests to free and reallocate memory blocks already allocated by the native memory manager.
This additional processing can reduce performance somewhat.
The slowdown might probably be noticeable in some cases in the GUI due to the constant redrawing of graphical controls that use memory reallocation.