pleriche / FastMM5

FastMM is a fast replacement memory manager for Embarcadero Delphi applications that scales well across multiple threads and CPU cores, is not prone to memory fragmentation, and supports shared memory without the use of external .DLL files.
283 stars 73 forks source link

Issue when exe and dll all with runtime package #25

Open pmiscn opened 3 years ago

pmiscn commented 3 years ago

Hi, When exe and dll are with runtime package, raise error testFastMM5Qplugins.zip "FastMM cannot be installed,because another third party memory manage has already been installed."

Thanks.

pleriche commented 3 years ago

When you use runtime packages those packages are initialized before your application or your library. Since the initialization code in some of those runtime packages also allocate memory, by the time FastMM5 tries to install itself it can no longer do so safely.

The solution is to add sharemem to the uses clauses of your application and library and thus have a static link to borlndmm.dll. You can then use the replacement borlndmm.dll that uses FastMM5 internally.