Jump to content
Leif Uneus

Experience/opinions on FastMM5

Recommended Posts

Posted (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 by abak

Share this post


Link to post

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

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
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.

  • Like 2
  • Thanks 2

Share this post


Link to post
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

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
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.

 

 

 

 

  • Thanks 1

Share this post


Link to post
Posted (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 by abak

Share this post


Link to post

@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
Posted (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 by abak

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

×