The leader in Profiling/Analysis tools for Delphi by a wide margin is obviously AQTime by AutomatedQA. They recently even gobbled up Memproof by Atanas Soyanov, which I understood was an excellent and free memory analysis tool, and incorporated its functionality into AQTime. But AQTime is very expensive for an individual programmer. It actually costs more than the upgrade to Delphi 2009 cost!

So my question is: Are there other less expensive options to do profiling and memory analysis in current versions of Delphi that you are happy with and recommend, or should I bite the bullet and pay the big bucks for AQTime?

Addenum: It seems the early answerers are indicating that the FastMM manager already included in Delphi is very good for finding memory leaks.

So then, are there any good alternatives for source code profiling?

One I'm curious about is ProDelphi by Michael Adolph which is less than one sixth the cost of AQTime. Do you use it? Is AQTime worth paying six times as much?

Addenum 2: I downloaded trial versions of both AQTime and ProDelphi.

AQTime was a bit overwhelming and a little confusing at first. It took a few hours to find some of the tricks needed to hook it up.

ProDelphi was very much like the GpProfile that I was used to. But its windows are cluttered and confusing and it's not quite as nice as GpProfile.

To me the big differences seem to be:

ProDelphi changes your code. AQTime does not. Changing code may corrupt your data if something goes wrong, but my experience with GpProfile was that it never happened to me. Plus one for AQTime.

ProDelphi requires you turn optimization off. But what you want to profile is your program with optimization on, the way it will be run. Plus one for AQTime.

ProDelphi only can profile down to the function or procedure. AQTime can go down to individual lines. Plus 2 for AQTime.

ProDelphi has a free version that will profile 20 routines, and its pro version costs less than $100 USD. AQTime is $600 USD. Plus 4 for ProDelphi.

The score is now 4-4. What do you think?

Addenum 3: Primoz Gabrijelcic is planning to get GpProfile working again. See his comments on some of the responses below. He on StackOverflow as Gabr.

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
If this question can be reworded to fit the rules in the help center, please edit the question.

Sorry, I have only experience with AQTime.
–
Toon KrijtheNov 14 '08 at 22:29

You should try the time-limited demo of AQTime. I had a lot of problems with it on my laptop which is set to 120 DPI - some dialogs were actually unusable because buttons were cut off. That did not inspire much confidence, and support said they couldn't do anything about it... :-(
–
mghieNov 14 '08 at 22:47

1

AQTime caused me some strange issues after it was installed automatically with Delphi XE2 Update 4. I had to uninstall AQTime to be able to use the most simple features of Delphi, such as "Complete Class at Cursor" wasn't working until I uninstalled AQTime.
–
Jerry DodgeMar 29 '12 at 18:45

12 Answers
12

For the price, you cannot beat FastMM4 as a memory tracker. It's simple to use yet powerful and well integrated with Delphi.
I guess that you know that, without downloading, installing or changing anything else, just putting this line

ReportMemoryLeaksOnShutDown := True;

anywhere in your code, will enable basic reporting of memory leaks.
If you need more like crash information, EurekaLog is a very good product that we use. MadExcept also has a good reputation...

The current public source is terribly outdated. I have much newer version on my disk, but it is still very much in the 'work in progress' state and I'm not brave enough to display such broken code. I'm planning to put GpProfile on the Google Code as soon as it is at leat partially working again.
–
gabrNov 15 '08 at 8:59

Hello gabr! Didn't know you were still around, and I see you're especially active on StackOverflow. I've used your GbProfile very happily for almost 10 years with Delphi 4. Great product, and very advanced for the time. I've love to hear your answer to the question I've posted here.
–
lkesslerNov 16 '08 at 5:58

1

p.s. Gabr: Your OmniThreadLibrary looks very interesting! I've never attempted threading because it always looked so complicated, but your library seems to make it very easy.
–
lkesslerNov 16 '08 at 6:10

2

There is a minor spelling error in the answer. "ReportMemoryLeakOnShutdown" should read "ReportMemoryLeaksOnShutdown" (at least in D2010).
–
conciliatorAug 9 '10 at 14:40

4

For tracking the FastMM allocation, virtual memory graph, dump or the system information summary you may check the FastMM Usage Tracker, (+1)
–
TLamaJan 18 '12 at 14:06

The main reason I made it was because I missed an exact call tree.
For example, ProDelphi only stores a summary and total counts of all calls,
you cannot see what calls a specific procedure at a specific time did (or time
duration).
And it has a time chart, so you can see how the call duration changed over time.

Sampling profilers never have done it for me, but thanks for our suggestion as it might be useful to some people.
–
lkesslerNov 16 '08 at 17:52

1

The problem is, they don't sample enough info. If they capture the whole call stack they can tell you which call instructions are costing you the most. It's more important to do that than to get high precision from a really large number of samples.
–
Mike DunlaveyNov 20 '08 at 2:04

2

It is one of the best sampling tools available @ Eric Grange's well done keep it up
–
VibeeshanRCNov 11 '11 at 5:55

30x is not unusual if you can get instruction-level cost. I do it by hand, by halting with a pause key a few times and recording the call stack. If some call is wasting 29 out of 30 cycles, you don't need 1000 samples to see it.
–
Mike DunlaveyNov 20 '08 at 1:54

For a profiler you might try SmartInspect from Gurock Software. I never used GpProfile, but quickly glancing at its feature set reminded me of SmartInspect. Interestingly it doesn't claim to be a profiler, but it seems to be as much of one as GpProfile (unless I am missing something). It supports Delphi 2009 and has a free Trial and is a little cheaper then AQTime.

I agree with you about the interface of ProDelphi, but it does a good enough job that we're happy to stay with it. We only need to profile very occasionally when we have a significant performance issue, and it's always helped us find the problem pretty quickly. Very good value for money, and Michael seems pretty good about keeping it updated for new versions.

One thing I would suggest is that because it does require code to be inserted, having all the relevant code in some kind of VCS is invaluable. When we need to profile, we:

A VCS in my case is overkill. What I do is copy my entire working directory to "copy of" the same directory. Then it is trivial for me to get back. I actually do that for every significant change I might be making.
–
lkesslerNov 16 '08 at 17:51

If you are looking for an easy and
accurate way to measure execution time
of your code for free, TProfiler is
what you need. TProfiler is a
non-visual and debugging component
that enables you to create named
timers in your code.

Each timer of TProfiler provides the
following information:

The number of times that the timer was
activated (Hit Count) The total
execution time The average execution
time on each hit Execution time on
the first hit Execution time on the
last hit The hit with minimum
execution time The hit with maximum
execution time

The FastMM4 memory manager mentioned in this older answer ("How to monitor or visualize memory fragmentation of a delphi application") keeps a list of all allocations which can be queried at run time (and displayed in a grid using the included demo application). It does not exactly show which object leaks, as the statistics are per block size. But it can be useful for long-time monitoring of applications in production, for example servers or services. I am currently integrating it in a (commercial) web application server framework as the 'VisualMM' add-on.