Delphi is to manually release the memory, if the client program has leaked, it may not be a big problem, but if you are using Delphi to do the service-side program, there is a leak, a long time will occupy a lot of memory, Until the server program closes the reboot. So the memory leak is still harmful. And there are a lot of leaks in the program, but also a bad phenomenon, to be corrected. Add the following code to the first sentence of the program execution: {$IFDEF Debug}reportmemoryleaksonshutdown: = debughook<>0; {$ENDIF} Then, if the program is leaking, the program will be the end of the error, but this error can only know the class type and quantity, there is no specific code line number. and the whole project content, how to quickly find leaks? The answer is to develop good habits in testing, Add this sentence to the project. Because we debug the program, it will be a module to debug. Then exit normally. This makes it very effective to find leaks. Even if the leak error dialog box shows the content is not very specific, but in debug debugging, the scope of the code executed is limited. So we can also quickly find out where the leaks are. I just use this to solve a lot of leaks. I wonder if you have this habit of Delphi fans?
Delphi a way to deal with memory leaks and tips