Jump to content

Newly released FastMM5


Pep

Recommended Posts

Hi

Be aware that the license has been changed at the same time.
You now have the option of commercial (from $ 99 per dev)
or GPL-v3.
The fact that he is going to ask for money is not so bad, it's the way how

Link to comment
Share on other sites

  • 2 weeks later...
On 5/18/2020 at 12:42 PM, picyka said:

It would be nice to have a tutorial on how to use FastMM on unigui, how to configure it.

 

The good news has come !

https://en.delphipraxis.net/topic/2749-experienceopinions-on-fastmm5/?do=findComment&comment=22717

 

FastMM5 USAGE :

 

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

{$IFDEF DEBUG}
FastMM5,
{$ENDIF}

 


5. 
begin
  ReportMemoryLeaksOnShutdown := True;
end;
 

 

Test with this simple test :

procedure TForm1.FormCreate(Sender: TObject);
var L:TStrings;
begin

  L:=TStringList.Create;
end;

And Close the Application :  you will see MemoryLeaks 

  • Like 1
Link to comment
Share on other sites

11 minutes ago, Abaksoft said:

 

The good news has come !

https://en.delphipraxis.net/topic/2749-experienceopinions-on-fastmm5/?do=findComment&comment=22717

 

FastMM5 USAGE :

 

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;
 

 

Test with this simple test :

procedure TForm1.FormCreate(Sender: TObject);
var L:TStrings;
begin

  L:=TStringList.Create;
end;

And Close the Application :  you will see MemoryLeaks 

And how would it be in unigui, can you put an example here?

Link to comment
Share on other sites

 

1 hour ago, picyka said:

And how would it be in unigui, can you put an example here?

The same way.

For closing your uniguiApplication, close it from TrayIcone (on the bottom beside windows Date).

Note : test memoryleaks only on Debug Mode (not Release).

  • Like 1
Link to comment
Share on other sites

15 hours ago, Abaksoft said:

Hello Abaksoft,

Thanks for the information, when I did the speed tests I did not verify that the "ReportMemoryLeaksOnShutdown" option was still working and now thanks to your detailed indications and suggestions I see that this option now works correctly.

It is important to note that this option is only available in the version of FastMM5 that was released yesterday !!

Thank you so much.

  • Like 1
Link to comment
Share on other sites

On 5/27/2020 at 11:10 AM, Abaksoft said:

in view of what I have read, we can use FastMM also in Release mode (a better memory management and Performance).

How to :

put it on the first Uses (.dpr file) :

uses

FastMM5,

....

begin

end.

 

Erratum :

As said by Mierlp and shown on the FastMM Forum :

Using FastMM5 now, "require to pay for a license if your project is not GPL/LGPL itself".

https://en.delphipraxis.net/topic/2749-experienceopinions-on-fastmm5/?do=findComment&comment=23123

Link to comment
Share on other sites

Hi Experts,

I detect a small problem with FastMM5  in Delphi 10.3.3 Pro.

This happens only with Unigui / FastMM5 

No problem with VCL / FastMM5 

No problem with Unigui / FastMM4

 

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"   raises !

   followed by :

     Acces Vilation at adress 2172415C in Module 'bds.exe',
     Read of adress 2172415C


Note :
Whit the original EMB (BorlndMM.dll)  no problem in Unigui.

I wrote to Pierre Leriche, but I had to delete my message, since the problem only appears with Unigui.

The conclusion I came to is to use FastMM4 with Unigui, since it is totally free and is stable.

_________

Regards.

 

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

Here is the single-threading performance comparison between FastMM5 (FastMM v5.01 dated Jun 12, 2020 and FastMM4-AVX v1.03 dated Jun 14, 2020). This test is run on Jun 16, 2020, under Intel Core i7-1065G7 CPU (base frequency: 1.3 GHz, 4 cores, 8 threads). Compiled under Delphi 10.3 Update 3, 64-bit target.

 

                                             FastMM5  AVX-br.   Ratio
                                              ------  ------   ------
    ReallocMem Small (1-555b) benchmark         9285    7013   24.47%
    ReallocMem Medium (1-4039b) benchmark      12002   10186   15.13%
    Block downsize                             12463    9474   23.98%
    VerySmall downsize benchmark               12025   11012    8.42%
    Address space creep benchmark              14212   10845   23.69%
    Address space creep (larger blocks)        16237   13629   16.06%
    Single-threaded reallocate and use         15462   13750   11.07%
    Single-threaded tiny reallocate and use     9263    7203   22.24%
    Single-threaded allocate, use and free     14885   14211    4.53%


You can find the program, used to generate the benchmark data,at https://github.com/maximmasiutin/FastCodeBenchmark

You can find FastMM4-AVX branch at https://github.com/maximmasiutin/FastMM4-AVX

On the tests above demonstrated, FastMM4-AVX branch is faster than FastMM5.

Besides that, FastMM5 uses "Winapi.Windows.SwitchToThread" call in multi-threading in an attempt to obtain a lock of a block manager. The "SwitchToThread" call is not a very efficient way in a spin-lock loop. A better way, even recommended by Intel, is to use "pause" instruction, e.g. 5000 times, and only then if it would not help, call "SwitchToThread". Usually, "pause" will help and the spin-lock will release before reaching 5000 iterations, so no "SwitchToThread" call will be needed.

The following should also be taken into consideration: (1) Each call to SwitchToThread() experiences the expensive cost of a context switch, which can be 10000+ cycles; (2) It also suffers the cost of ring 3 to ring 0 transitions, which can be 1000+ cycles; (3) SwitchToThread() may be of no use if no threads are in the ready state.

The FastMM4-AVX branch checks if the CPU supports SSE2 and thus the "pause" instruction, it uses "pause" spin-loop for 5000 iterations before calling "SwitchToThread". If a CPU doesn't have the "pause" instruction or Windows doesn't have the SwitchToThread() API function, it will use EnterCriticalSection/LeaveCriticalSection.

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...
On 6/16/2020 at 1:38 AM, Maxim Masiutin said:

You can find FastMM4-AVX branch at https://github.com/maximmasiutin/FastMM4-AVX

Hi Maxim,

I do not know if that can help you, but I detected a small problem with the borlndmm.dll (suggested in your Pack  FastMM4-AVX v1.03 dated Jun 14, 2020) :
UniPageControl + borlndmm.dll (FastMM4-AVX v1.03) = AV

If you are familiar with Unigui :


1. Create a new Empty Unigui  Project,

2. Place on the Main UniPageControl

3. On UniPageControl, Creat a New Page

4. Save Project

5. File > Close Project

You will see the AV.

The problem not occurs with the Original borlndmm.dll  camed from EMB.

_________________

Delphi 10.3.3 Pro

Best Regards

AV_50067A6_RTL260BPL_80808088.txt

Link to comment
Share on other sites

  • 1 month later...
  • 1 year later...

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...