abak 0 Posted May 19, 2020 (edited) Hello Sirs, First, I would like to thanks Pierre Le Riche for its Great Work ! I just : 1. Downloaded the latest FastMM5 from https://github.com/pleriche/FastMM5 2. Replace the Original BorlndMM.dll : C:\Program Files (x86)\Embarcadero\Studio\20.0\bin\BorlndMM.dll By the newer (i complided FastMM5-master\BorlndMM DLL ) 3. Add to the Library : Options > Delphi > Langage > Library ...\FastMM\FastMM5-master\FastMM5-master 4. Add the first uses on the Project (Main program) uses FastMM5, 5. begin ReportMemoryLeaksOnShutdown := True; end; Then, when testing a simple test : procedure TForm1.FormCreate(Sender: TObject); var L:TStrings; begin L:=TStringList.Create; L.Add('abc'); end; No memoryLeaks raises ! Did I mistake a step ? Please advise. Edited May 19, 2020 by abak Share this post Link to post
Günther Schoch 61 Posted May 19, 2020 Hi under FastMM5 you can switch all the reporting functions during runtime (no compile switches) Please have a look under FastMM_ApplyLegacyConditionalDefines you can use {$ifdef EnableMemoryLeakReporting} and {$ifdef RequireDebuggerPresenceForLeakReporting} or switch directly in you app I personally changed the behavior FastMM_ApplyLegacyConditionalDefines to fit to my "default" behavior = when debugging then always show leaks. Share this post Link to post
abak 0 Posted May 19, 2020 Thank youGünther Schoch, 1. I Modified the procedure FastMM_ApplyLegacyConditionalDefines (and MemoryLeaks appears) as : procedure FastMM_ApplyLegacyConditionalDefines; begin FastMM_LogToFileEvents := FastMM_LogToFileEvents + [mmetUnexpectedMemoryLeakDetail, mmetUnexpectedMemoryLeakSummary]; FastMM_MessageBoxEvents := FastMM_MessageBoxEvents + [mmetUnexpectedMemoryLeakSummary]; end; 2 OK How can FastMM5 detect LegacyConditionalDefines. Do we have to copy FastMM4Options.inc into then new Directory \FastMM5-master ? 3. 3 hours ago, Günther Schoch said: under FastMM5 you can switch all the reporting functions during runtime (no compile switches) Not obvious for me. Can someone show an example Appreciate help. Share this post Link to post
Pierre le Riche 21 Posted May 19, 2020 4 hours ago, abak said: ReportMemoryLeaksOnShutdown := True; I have now added support for this. Previously you needed to execute "Include(FastMM_MessageBoxEvents, mmetUnexpectedMemoryLeakSummary);" to get a leak summary on shutdown, but now if ReportMemoryLeaksOnShutdown = True it will do that automatically. 1 hour ago, abak said: OK How can FastMM5 detect LegacyConditionalDefines FastMM5 does not support the v4 options file, but it does support the v4 defines if you declare then in Project - Options - Delphi Compiler - Conditionals defines. If that is not convenient I recommend you use the equivalent v5 options instead - the v4 conditional defines support is just for backward compatibility. 2 2 Share this post Link to post
abak 0 Posted May 19, 2020 1 hour ago, Pierre le Riche said: I have now added support for this. Previously you needed to execute "Include(FastMM_MessageBoxEvents, mmetUnexpectedMemoryLeakSummary);" to get a leak summary on shutdown, but now if ReportMemoryLeaksOnShutdown = True it will do that automatically. FastMM5 does not support the v4 options file, but it does support the v4 defines if you declare then in Project - Options - Delphi Compiler - Conditionals defines. If that is not convenient I recommend you use the equivalent v5 options instead - the v4 conditional defines support is just for backward compatibility. Thank you so much Pierre You simplfy many things for us ! Share this post Link to post
abak 0 Posted May 20, 2020 Hello Experts, For the Performance of deployed applications (a better memory management) how can we integrate (and where deploy it with our application) the new BorlndMM.dll ? Thx Share this post Link to post
Pierre le Riche 21 Posted May 20, 2020 5 hours ago, abak said: For the Performance of deployed applications (a better memory management) how can we integrate (and where deploy it with our application) the new BorlndMM.dll ? If you have applications that are currently using borlndmm.dll you can just replace it with one compiled using FastMM5, The source for it is in the "BorlndMM DLL" subfolder. For new applications I recommend that you use FastMM5 directly - add it as the first unit in your project's dpr file. 1 Share this post Link to post
abak 0 Posted May 20, 2020 (edited) 6 hours ago, Pierre le Riche said: If you have applications that are currently using borlndmm.dll you can just replace it with one compiled using FastMM5, The source for it is in the "BorlndMM DLL" subfolder. For new applications I recommend that you use FastMM5 directly - add it as the first unit in your project's dpr file. Thx again for the details. If I understand, for new applications and for a good practice, now, all Delphi programmer should integrate FastMM5 in its uses project's dpr file. By this way, these applications will have better memory management (than with the original from EMB/ BorlndMM DLL). Is it True ? Edited May 20, 2020 by abak Share this post Link to post
Arnaud Bouchez 407 Posted May 29, 2020 @abak My advice to switch to FastMM5 only if 1. you actually tested and saw a noticeable (on wall clock) performance improvement 2. and you are OK with the licence terms. I doubt point 1. will happen in most cases, i.e. if your app is not heavily multi-threaded, but is a regular VCL/DB app. Point 2 would require to pay for a license if your project is not GPL/LGPL itself. Share this post Link to post
abak 0 Posted May 29, 2020 (edited) 8 hours ago, Arnaud Bouchez said: @abak My advice to switch to FastMM5 only if 1. you actually tested and saw a noticeable (on wall clock) performance improvement 2. and you are OK with the licence terms. I doubt point 1. will happen in most cases, i.e. if your app is not heavily multi-threaded, but is a regular VCL/DB app. Point 2 would require to pay for a license if your project is not GPL/LGPL itself. Thank you Arnaud, I totally agree with. @Pierre le Riche Hi Pierre, I detect a small problem with FastMM5 in Delphi 10.3.3 Pro (authentic EMB Licence). Maybe I did wrong things. Just test this : 0. Add Library (32) : ...\FastMM\FastMM5-master\FastMM5-master 1. Run Delphi 10.3.3 Pro (with original borlndmm.dll in ..\bin) 2. Open ...\FastMM5-master\BorlndMM DLL\BorlndMM.dpr 3. Compile (Relase or Debug) 4. Quit Delphi 5. Just rename the original as : borlndmm_OLD.dll and replace it by the newer : BorlndMM.dll 5. Run Delphi 6. Quit Delphi then the message : "Invalide Pointer Operation" resises ! followed by : Acces Vilation at adress 2172415C in Module 'bds.exe', Read of adress 2172415C Note : Whit the original EMB (BorlndMM.dll) no problem. Best Regards. ________________________________________________________________ Edited 29/05/2020 17:40 : The problem disappeared when i restarted the PC. Sorry for the alert. Edited May 29, 2020 by abak Share this post Link to post
Attila Kovacs 629 Posted March 18, 2022 (edited) I have an app which downloads table data's from a server with CleverComponents + OmniThreadLibrary. Data is json, zipped, encoded. All CPU is used for downloading and importing the data into an SQL server. Here are some results with FastMM 4 (default) vs. 5 using Berlin U2. 32bit FastMM4 Sync done in 138,29 Sec 32bit FastMM5 Sync done in 106,903 Sec 64bit FastMM4 Sync done in 144,357 Sec 64bit FastMM5 Sync done in 107,587 Sec I was shocked by these numbers so I thought I'm sharing my experience. Edited March 18, 2022 by Attila Kovacs 1 Share this post Link to post
PeterBelow 238 Posted March 19, 2022 14 hours ago, Attila Kovacs said: I have an app which downloads table data's from a server with CleverComponents + OmniThreadLibrary. Data is json, zipped, encoded. All CPU is used for downloading and importing the data into an SQL server. Here are some results with FastMM 4 (default) vs. 5 using Berlin U2. 32bit FastMM4 Sync done in 138,29 Sec 32bit FastMM5 Sync done in 106,903 Sec 64bit FastMM4 Sync done in 144,357 Sec 64bit FastMM5 Sync done in 107,587 Sec I was shocked by these numbers so I thought I'm sharing my experience. What's so shocking about these numbers? Share this post Link to post