pleriche / FastMM4

A memory manager for Delphi and C++ Builder with powerful debugging facilities
447 stars 158 forks source link

LogMemoryManagerStateToFile doesn't log anything when used in a Dll #59

Open MrWaz opened 6 years ago

MrWaz commented 6 years ago

Hi and thanks for your great tools.

I'm having a rough time trying to track memory leaks for memory allocated in a dynamically loaded dll.

Trying to use the standard 'report on shutdown' facility, all objects are reported as 'unknown' with no stack trace information at all. Well I can admit it as the dll has been unloaded at this time.

I then tried the LogMemoryManagerStateToFile function inside my dll to get snapshots information and do manual comparisons. Unfortunately, the function does not report anything worthy.

FastMM State Capture:
---------------------

0K Allocated
0K Overhead
100% Efficiency

Usage Detail:

It's exactly the same behavior when trying to do the same in your Dynamically Loaded DLL demo adding a call to LogMemoryManagerStateToFile in TfDLLMain.Button1Click

I'm using full debug mode and if I add the same call in the TestApplication.exe, I get a correct report.

Hope someone here can help.

Regards Sylvain