Jump to content
Registration disabled at the moment Read more... ×
Ian Branch

Delphi Memory Managers?

Recommended Posts

Hi Guys,

This might be one of those personal preference things...

Does anybody have any view on using the built in (Delphi Rio) memory manager v using FastMM4 or ScaleMM2?

Or any other 3rd Party Delphi Memory manager for that matter?

I use EurekaLog for error trapping so I don't need/use that functionality from FastMM4 per se.

 

Thoughts, preferences. reasons?

 

Regards,

Ian

Share this post


Link to post

Depends on your program's requirements and memory usage patterns. 

 

What are you trying to achieve with a change of memory manager? 

Edited by David Heffernan

Share this post


Link to post

Delphi default MM is a cut-down version of FastMM4 on Windows.
You may achieve slightly better performance on multi-threading by using FastMM4 with some custom conditionals.

 

IIRC on Apple, Linux or mobile platforms, it uses the clib heap manager. Which is not bad in practice. 

 

ScaleMM2 or others - like BrainMM - may be better for multi-threaded apps, but tend to consume much more memory.

Under Linux, switching to Intel TBB or JMalloc may give a performance boost, but will also consume much more memory - see my tests with FPC https://github.com/synopse/mORMot/blob/8a55fb3bf2d4cffeb779dd19a8be18e227188f2f/SynFPCCMemAligned.pas#L68

 

But the main performance enhancement would probably be by changing your algorithms...
Mainly avoiding heap allocations...
See http://blog.synopse.info/post/2018/11/12/EKON-22-Slides-and-Code

Edited by Arnaud Bouchez
  • Like 4

Share this post


Link to post

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×