A high-performance fork of FastMM4 with AVX/AVX2/AVX512 support, efficient synchronization, and FreePascal compatibility.
FastMM4-AVX is an optimized memory manager for Delphi and FreePascal applications, designed to replace the default memory allocator with faster, more scalable performance. It enhances the original FastMM4 with support for AVX instructions and improved synchronization techniques, making it particularly effective in multi-threaded environments.
Delphi and FreePascal developers building high-performance, multi-threaded applications where memory allocation speed and low contention are critical.
Developers choose FastMM4-AVX for its proven performance gains in multi-threaded scenarios, modern CPU feature utilization, and compatibility with both Delphi and FreePascal compilers without requiring external DLLs.
Fork of FastMM4 by Pierre le Riche with AVX/AVX2/AVX512 support, efficient synchronization, and FreePascal (FPC/Lazarus) compatibility
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Benchmarks show over 50% speed improvements in high-contention scenarios, such as the NexusDB test with 64 threads running twice as fast, due to efficient pause-based spin-wait loops and optimized synchronization.
Leverages AVX1/AVX2/AVX512, ERMS, and FSRM for faster memory copies, with secure register clearing via vxorps/vpxor to prevent data exposure in XMM/YMM/ZMM registers.
Supports Embarcadero Delphi and FreePascal/Lazarus on Win32, Win64, and Linux 64-bit, with code safety enhancements like stricter type adherence and support for compiler overflow checking.
Offers flexible locking via critical sections, WaitPKG instructions, or spin-waits, with compile-time options to tune for specific contention levels and avoid unnecessary bus locking.
AVX instructions can cause slowdowns from AVX-SSE transition penalties and reduced CPU turbo frequency, with the README admitting that benefits are negligible or negative in some cases, advising to disable AVX.
Safe-unlinking protection is not implemented (as noted in remaining issues), and double-free detection is only available in FullDebugMode, leaving production builds vulnerable to memory corruption attacks.
Requires managing numerous conditional defines (e.g., DisableAVX, EnableWaitPKG) and alignment settings, which can be daunting for integration and error-prone without deep understanding.
The UseReleaseStack feature must be avoided in DLLs due to deadlocks during unload, as documented in known limitations, forcing developers to compromise on performance or risk system hangs.