Solution for Indy 10 memory leaks lazarus / 38-Networking and Web Programming ---------------------------------------------------------------------- JD · 2011-09-07 23:45 Hi there everyone, I've noticed that Indy 10 has memory leaks for a while and had wondered how to eliminate them. Recently, Remy Lebeau told me that the memory leaks (in IdStack.pas and IdThread.pas) are deliberate but that defining FREE_ON_FINAL and recompiling Indy would solve the problem. These are the steps I took a) Open the IdCompilerDefines.inc file b) Define the FREE_ON_FINAL directive in the file as shown below Before // $DEFINE the following if the global objects in the IdStack and IdThread // units should be freed on finalization {.$DEFINE FREE_ON_FINAL} {$UNDEF FREE_ON_FINAL} After // $DEFINE the following if the global objects in the IdStack and IdThread // units should be freed on finalization {$DEFINE FREE_ON_FINAL} {.$UNDEF FREE_ON_FINAL} c) Recompile and reinstall Indy 10 Now I feel better. I don't like loose ends.  I hope someone else finds this useful. ---------------------------------------------------------------------- avra · 2011-09-08 09:17 If in the future you happen to have a 24/7 working Indy application which runs without leaks for a month or more, please report here. ---------------------------------------------------------------------- JD · 2011-09-08 10:02 Quote from: avra on September 08, 2011, 11:17:46 amIf in the future you happen to have a 24/7 working Indy application which runs without leaks for a month or more, please report here.    I'm just a user like you avra. The best thing we can do for the developers is to report such bugs so that they can be corrected. P.S. I'm using the svn release (Indy10_4667) of August 2, 2011. ---------------------------------------------------------------------- m.vincent · 2011-09-20 16:28 Did Remy Lebeau say why the memory leaks were deliberate? It seems to be a rather odd thing to do. Mike ---------------------------------------------------------------------- JD · 2011-09-20 19:45 Quote from: m.vincent on September 20, 2011, 06:28:16 pmDid Remy Lebeau say why the memory leaks were deliberate? It seems to be a rather odd thing to do. Mike That's exactly what he said. ---------------------------------------------------------------------- marcov · 2011-09-20 20:07 Quote from: JD on September 08, 2011, 01:45:26 amHi there everyone, I've noticed that Indy 10 has memory leaks for a while and had wondered how to eliminate them. Recently, Remy Lebeau told me that the memory leaks (in IdStack.pas and IdThread.pas) are deliberate but that defining FREE_ON_FINAL and recompiling Indy would solve the problem. What problem? The sources are known. ---------------------------------------------------------------------- Remy Lebeau · 2021-12-15 17:04 Quote from: m.vincent on September 20, 2011, 06:28:16 pmDid Remy Lebeau say why the memory leaks were deliberate? https://forum.lazarus.freepascal.org/index.php/topic,39257.msg428027.h tml#msg428027