Join 34,000+ subscribers and receive articles from our blog about software quality, testing, QA and security.

Memory leak in LogObject


Hi there,

While checking the Delphi project I’m currently working on for memory leaks (using MemCheck version 2.73), I came across some small memory leaks in the LogObject method of the TSiSession object. MemCheck provided the following data regarding the leaks.

call stack - 1 : Module TypInfo.pas
Routine @Typinfo@GetPropList Line 1115 Find error: 0041D126
call stack - 2 : Module SmartInspect.pas
Routine FillObjectData Line 10882 Find error: 00474D77
call stack - 3 : Module SmartInspect.pas(no debug info) Line 10978 Find error: 00475577

I hope this information helps you fix this problem.



Hello Gerben,

thanks for reporting the bug. I could reproduce the problem and fixed it already. The fix will be included in the upcoming 1.4 release. Thanks again!


Hi again,

I might have been jumping the gun a bit with my previous post. Eventhough the memory leaks are gone when I don’t use the LogObject procedure, I’m not totally sure SmartInspect is to blame anymore. You may want to delete this post. I’ll repost if I think it is necessary.

Thanks in advance…




Hehe, seems that we were writing at the same time :). However, you were right, there was a problem in LogObject. I found out that the RTTI API of Delphi allocates a bunch of memory every time LogObject is called. LogObject properly frees the memory now.