In Delphi I have configured to report memory leaks:
{$IFDEF Debug}
ReportMemoryLeaksOnShutdown := true;
{$ENDIF}
After exiting the program I get the following message:

My program is very big and I have no clue how to find the TStringList which I have created but not freed.
Unfortunately Delphi has no garbage collector...
If I search in my project for TStringList I find ~500 occurences. It doesn't make any sense to check all of them.
How can I find the variable which I forgot to free?


The following software helps to hunt memory leaks:
https://github.com/shadow-cs/delphi-leakcheck
Here the steps to follow:
cd C:\Delphigit clone https://github.com/shadow-cs/delphi-leakcheckC:\Delphi\delphi-leakcheck\Sourceto your Delphi library path (Tools/Options/...)MyProject.dprfile:Code:
Exiting may need up to several minutes (be patient...)
C:\Delphi\MyProject\MyProject.logwas created.This log file contains the name of the function (and its callstack) where the variable was created. It's not the name of the unfreed variable, but at least the function and line number inside this function.
This approach solved my problem within several minutes.
Bonus: this software is completely free - you don't have to pay anything for it