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

Does FastMM4 compatible configuration work #10

Open nz-markk opened 4 years ago

nz-markk commented 4 years ago

From what I read I thought the FastMM4 defines would work with FastMM5. I've just tried switching from 4 to 5 to compare speed during debug but am no longer getting a detailed leak log file (or any log file) with FastMM4Options.inc in the runtime folder or if I add a {$include FastMM4Options.inc} to the dpr

I did manage to get leak detail logging working by adding mmetUnexpectedMemoryLeakDetail to FastMM_LogToFileEvents which showed that logging could work and the options file was not working as the other settings in it, eg file delete on start, were not working

Is there something extra I need to do?

pleriche commented 4 years ago

Hi Mark,

FastMM5 does not use the FastMM4Options.inc file, since the {$include} directive would raise a compiler error if the file was not present (which is usually the case). In order to use the v4 defines you have to specify them in Project Options -> Compiling -> Conditional Defines.

Including the file in the DPR won't help, since the scope of the defines would then be local to the DPR.

Not all the v4 conditional defines are supported, only the most useful ones that still apply to v5. If you spot a v4 defines that you deem critical that are missing, please let me know.

Best regards, Pierre

nz-markk commented 4 years ago

Ah yes I'm a doofus, mixing up my C++/Delphi include files and scoping!!!!

I'll fix that and try them out.

Cheers Mark

nz-markk commented 4 years ago

Here's the first one I noticed missing, ClearLogFileOnStartup

Fixed by adding the following to FastMM_ApplyLegacyConditionalDefines {$ifdef ClearLogFileOnStartup} FastMM_DeleteEventLogFile(); {$endif}

pleriche commented 4 years ago

Here's the first one I noticed missing, ClearLogFileOnStartup

Thanks, I've pushed a fix for that.