- #Delphi xe10 static function memory leak full version#
- #Delphi xe10 static function memory leak manual#
- #Delphi xe10 static function memory leak full#
- #Delphi xe10 static function memory leak code#
When you press Take Snapshot Deleaker briefly freezes the information and collates a whole bunch of information it requires. You can then see all the allocations that have not been deallocated and look for any you weren’t expecting. The idea is to take an initial snapshot (using the Take Snapshot button) as a baseline, then shortly thereafter take another snapshot and compare the two. OK, that gives a view of consumption and in a real application potentially indicates an issue, so now we can use snapshots to look for a potential problem. The initial slope up was the application startup and the addition rise was the memory allocations caused by the button presses. Procedure TForm1.Button1Click(Sender: TObject) Įnd Running this up and battering Button1 shows this in the resource graph.
#Delphi xe10 static function memory leak code#
Let’s do a simple test on a simple memory leak by some code like this:
There is a button to invoke the resource usage graph, which allows you to see a dynamic representation of resource consumption over the last 60 seconds. You can see we have support for taking and comparing snapshots, which is the mechanism we use to identify leaks in the application. Here you get a flavour of what is on offer. When not debugging the window looks like this (note that when using this from within RAD Studio this is a dockable window, so you can tuck it away in your preferred area of the IDE’s UI): This menu allows you to enable or disable Deleaker’s interest in your project, set some options via a dialog and display the Deleaker window (the UI is the same in the standalone tool as it is in the IDE integration).
The typical way a Delphi or C++Builder developer would use Deleaker is using the IDE integration – there is a Deleaker menu added between Run and Component in the main menu.
#Delphi xe10 static function memory leak full#
I should mention up front that this is a commercial tool, like FastMM5 (when not used with the GPL license) and unlike FastMM4, Delphi LeakCheck, MemCheck 1 and TCondom 2. It’s taken me a while to clear my desk sufficiently to check it out but I’m pleased to have done so, as it’s a very nice and helpful tool. Some while back I got pointed in the direction of another leak detection tool, Deleaker from Softanics, of which I hadn't heard at that point. It does the job, but takes a back seat once the details have been discovered.
#Delphi xe10 static function memory leak manual#
However it is true that the business of working through the FastMM4 reports is somewhat manual – reports and call stacks are sent out via debug strings or log flies and then you have to pore over the details and work things backward to the source of the problem. FastMM4 is great for identifying memory leaks, memory corruption, interface misuse and so on, and locating the source of the problem via a call stack.
#Delphi xe10 static function memory leak full version#
As I've made clear many times in conference talks I’m a big fan of FastMM4, the full version Delphi’s built-in memory manager (I haven’t yet tried out FastMM5, which is fully rewritten but now has either a GPL or a commercial license).