Making Sure Your App Doesn’t Leak like a Sieve


If you have been following the Delphi Roadmap, you know that a Unified Memory model across all supported platforms is coming.  That memory model is Delphi’s standard ownership model coupled with optional interface refcounting.  IOW, it’s completely up to the developer to ensure proper memory management just as it has always been.  Once this is the case, memory management, especially on memory “constrained” mobile devices will be very important.
FastMM4 provides memory leak reporting on shutdown, and since everyone has 80% or better unit test coverage using this feature, they probably don’t need have another tool in their toolbox ;-).  Just in case you don’t I would consider adding DeLeaker to your toolbox.  It does far more than just check for memory leaks, and it does so at run-time!
DeLeaker comes as both an external EXE and a very similar UI integrated into RAD Studio under it’s own menu.  The documentation is well written and tutorials are available to get you up to speed quickly.
One of the things I like most about DeLeaker is the ability for it to monitor resource consumption live.  As you use the application you can see the memory utilization and spot potential leaks as memory consumption grows, confirm them using DeLeaker’s detection and go to the relevant code with a double click.
It also supports taking snapshots as the application runs, and comparing them.  Did I mention it monitors not only memory, but also GDI, handles and other resources?
You might think I have AQTime included with Delphi, and I would ask where?  It hasn’t been provided with Delphi for a number of releases.  I have used AQTime and it’s a great product, but I recently discovered that the standard edition doesn’t even support 64 bit EXEs.  Smartbear seems more focused on it’s new web product portfolio so perhaps choosing a smaller vendor committed to supporting RAD Studio customers would be prudent.  At $599 USD for AQTime Pro compared with $399 USD for Deleaker it’s a good value equation if you don’t need the additional features of AQTime Pro.
I have numerous tools in my toolbox, and I am always looking for new or better ones.  I am now adding DeLeaker to the list.

Comments are closed.