Jump to content
uwelabs

FastMM5. Can't get a log file

Recommended Posts

I'm just trying out FastMM5. In version 4 I always got a log file written to disk. But I cannot persuade FastMM5 to write a log file to disk. Does anybody know how this can be achieved?

Best regards, Uwe.

Share this post


Link to post

You can call FastMM_ApplyLegacyConditionalDefines if you already have defines in your code to control logging; it will then use them.

But there is new, finer, control of the logging for FastMM5 and you can select FastMM_LogToFileEvents as you wish.  The extensive documentation in the source describes all this, and there are basic instructions about logging options at https://github.com/pleriche/FastMM5.

 

Someone (but perhaps not from the USA during this holiday season) will no doubt be along help with a more comprehensive answer; I mainly make do with the defaults.

 

Share this post


Link to post

Thank you for your answer. Unfortunately I have still problems with writing a log to disk.

In Projects / options / Delphi Compiler Conditionals I put
DEGUG and FullDebugMode

The procedure FastMM_ApplyLegacyConditionalDefines is not callable in the application, but It is called in function FastMM_Initialize in FastMM5.pas. This function is called when starting the application (which I can test with the debugger). So a log file should be written, but unfortunately it is not ..?..

The variable FastMM_LogToFileEvents  is set to a lot of events in FastMM5.pas. But I'm at a loss how to use it for persuade FastMM to write a log to disk at all ..?..

Best regards, Uwe.

Share this post


Link to post

I also have problems with logging and here is what I did to get log file.

I make FastMM5.INC in FastMM5 directory.

{$define FastMM_EnableMemoryLeakReporting}
{$define FastMM_FullDebugMode}
{$define FastMM_UseOutputDebugString}
{$define FastMM_ClearLogFileOnStartup}

{$define FastMM_EnterDebugMode}

Then, included FastMM5.INC in FastMM5.pas before interface.

unit FastMM5;
{$Include FastMM5.inc}
interface

Now, when I add FastMM5 in some project I'm getting log file.

  • Like 3

Share this post


Link to post

Ok go to FastMM5.pas line 144

{.$Include FastMM5.inc}   // Enable to turn on log leaks to file

Remove dot and it works 😀

Share this post


Link to post

semi-OT: I'm doing some debugging and getting some memory leaks. I've used FastMM4 a lot over the years, and it would always drop a log file that was in a specific format. I built a small viewer that parses the file and gives me a more useful look at the data.

 

But on my current project, it only drops the log file if there's an exception thrown or some kind of actual error. Otherwise it shows the log in a popup window upon exit, and if I save it, I can't parse it the same as the regular log file (it's very different).

 

I haven't changed any of the options in forever. When I go through the options in the IDE for the project, I tell it to ALWAYS save a debug file. But I don't see a flag that says "only on errors". 

 

Any thoughts on what the problem could be?

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×