The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,860 other subscribers

Archive for the ‘FastMM’ Category

Vintage Dave is working on a new multithreaded memory manager for Delphi that does not have a global lock

Posted by jpluimers on 2013/06/19

The comment thread at via [WayBack] The Oracle at Delphi » Give in to the ARC side (now at [WayBackplace 1 and [WayBack] 2) is very interesting.

So soon after writing a StackOverflow [WayBackanswer on Delphi Memory Managers yesterday, [WayBack] this one by [WayBack] David M (aka vintagedave) caught my eye:

This is unannounced at the moment, but I am working on a new memory manager which does not have a global lock, and is designed for multithreaded usage, including cases where memory is allocated in one thread and freed in another, and many threads are allocating and freeing at once. It also uses a more secure design than FastMM4, which may be important for world-facing code, eg web servers. It’s a personal project which I have not yet announced, but if you are interested (Allen, Guenther, others) please feel free to contact me at vintagedave@gmail.com.

I wonder if it is better than the multithreaded Delphi memory managers I mentioned in the answer:

As a side note:

One of the reasons for using FastMM is the excellent debugging capabilities. It looks like – though not free – DDDebug extends this a lot!

I found it in Wanted: live leak detection for FastMM – DelphiFeeds.com and [WayBackTURBU Tech » Blog Archive » Wanted: live leak detection for FastMM.

–jeroen

via The Oracle at Delphi » Give in to the ARC side.

Posted in Delphi, Delphi XE4, Development, FastMM, Software Development | Tagged: , , , , | 9 Comments »

FastMM4 download available for Delphi XE3

Posted by jpluimers on 2012/09/05

At the day of the Delphi XE3 release Piere le Riche released the download version of FastMM4 (now version 4.991) that is compatible with Delphi XE3.

change log:

Version 4.991 (3 September 2012)

  • Added the LogMemoryManagerStateToFile call. This call logs a summary of
    the memory manager state to file: The total allocated memory, overhead,
    efficiency, and a breakdown of allocated memory by class and string type.
    This call may be useful to catch objects that do not necessarily leak, but
    do linger longer than they should.
  • OS X support added by Sebastian Zierer
  • Compatible with Delphi XE3

Note:

The download is ready, but the FastMM source repository on SourceForge is not yet updated.

–jeroen

via: FastMM | Free Development software downloads at SourceForge.net.

Posted in Delphi, Delphi XE3, Development, FastMM, Software Development | 1 Comment »

Delphi – Using FastMM4 part 3: wrong persistent field type (TSmallIntField or TWordField) when getting IsNull results in memory corruption

Posted by jpluimers on 2009/08/17

This is the third post in a series around using FastMM4.
The start of the series contains a listing of other posts as well and will be updated when new posts become available.

This particular case is about detecting memory overwrites like FastMM has detected an error during a FreeMem operation. The block footer has been corrupted..
Some of them are extremely hard to pin down, especially because there are usually two cases:

  1. Allocated memory that is too small to hold the data structure
  2. Free memory that still has a reference to it, which is used after it was freed

This post is on the first case.
A future post will handle an example of the last case.
Read the rest of this entry »

Posted in Database Development, Delphi, Development, FastMM, Software Development | 2 Comments »

Delphi – Using FastMM4 part 2: TDataModule descendants exposing interfaces, or the introduction of a TInterfacedDataModule

Posted by jpluimers on 2009/08/10

This is the second post of a series of posts around using FastMM4.
The start of the series contains a listing of other posts as well and will be updated when new posts become available.

One of the larger projects I’ve becoming involved in, uses a pattern that uses TDataModule descendants exposing interfaces.
Interfaces in Delphi are nice: if used properly, you have reference counting that will automatically free the underlying objects if there are no references left to them.

When you do not do interfaces in Delphi properly, you are bound to have a lot of memory leaks, and this is one of the cases where we did.
The client choose to do testing and QA very late in the product cycle, and we choose to use FastMM to do memory debugging.
Lo and behold: a truckload of memory leaks appeared all having to do with those datamodules.

As a side node:
Another thing we bumped into at an earlier stage was lifetime management in general: (both interface and object) references were kept to objects long after they were disposed.
That caused a lot of EAccessViolation
pain.
It is best not to mix the “interface reference” pattern with the “owned component” pattern: you usually end up with many more EAccessViolation exceptions.

This article is about finding the memory leaks caused by the way the interfaces were exposed from the TDataModule descendants, and a solution for preventing them by introducing the concept of TInterfacedDataModule.
Read the rest of this entry »

Posted in Conference Topics, Conferences, Database Development, Debugging, Delphi, Development, Event, FastMM, Software Development | 10 Comments »

Delphi – FastMM: Using FastMM4 for debugging your memory allocations – part 1: Introduction

Posted by jpluimers on 2009/07/29

I’m using FastMM in our projects when debugging memory allocations.

It is a great tool, but documentation is sparse.
Hence this post: point to some introductory articles and add some of my own experiences.

Later on, I will show some more advanced use.
These posts are already available in this series:

  1. Delphi – FastMM: Using FastMM4 for debugging your memory allocations – part 1: Introduction
  2. Delphi – Using FastMM4 part 2: TDataModule descendants exposing interfaces, or the introduction of a TInterfacedDataModule

So now lets get on with the introduction:
Read the rest of this entry »

Posted in Delphi, Development, FastMM | 23 Comments »

Delphi – backwards compatibility: using {%File to add non-Delphi files to your project in the .dpr

Posted by jpluimers on 2009/07/27

When you add a non-Delphi file to your project, the current (Galileo based) IDE’s add them only to your .dproj file.
But older Delphi’s used to add them to the .dpr file using the (undocumented) {%File pseudo-directive.

When including the file ..\src\Defines.inc, you need this pseudo-directive: {%File ‘..\src\Defines.inc’}

The .dpr import wizard knows about it: if you have a lonely .dpr file using the {%File pseudo-directive, it will be correctly reflected in the .dproj file.
Read the rest of this entry »

Posted in Delphi, Development, FastMM | Leave a Comment »