uwelabs 0 Posted November 26, 2020 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
timfrost 78 Posted November 26, 2020 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
uwelabs 0 Posted November 28, 2020 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
P@Sasa 3 Posted January 14, 2022 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. 3 Share this post Link to post
Berocoder 14 Posted December 8, 2022 Thanks for the hint. I had the exact same problem Share this post Link to post
Berocoder 14 Posted February 1, 2023 Thanks for the hint. I had the exact same problem Share this post Link to post
Berocoder 14 Posted February 1, 2023 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
David Schwartz 426 Posted February 2, 2023 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
Fr0sT.Brutal 900 Posted February 3, 2023 That's weird. Try to trace FastMM sources where the messagebox is shown Share this post Link to post