I was writing a game component in Delphi, and somehow, whenever the game's component settings got changed, the game was leaking memory.
Using MemCheck with Delphi 7 SP 1, I managed to figure out where the memory leak was, and fixed the leak.
MemCheck is a free tool, which comes with complete source code. In the initialization section of any unit, preferably, the first unit that is listed in the project's clause, issue a call to MemChk.
When you close your application, MemCheck opens up your editor, and displays all the stack calls. Each stack trace is shown with the number of bytes leaked, and the number of times called.
If you're a programmer worth your weight in either dilithium or trilithium, you should be able to work out where your memory leaks are from there.
In 2017, with the release of Delphi 10.2 Tokyo, Embarcadero introduced a specialized implementation of the Observer pattern into the System.Classes unit. While it has been in the wild for 9 years, it remains a "hidden" architecture for many, primarily because it serves as the invisible engine behind LiveBindings. Other than live bindings, you can also use the Observer pattern as a way to update component settings to the Windows registry, an .ini file, or persist it elsewhere.
System.Classes