Is there any third party solution , VCL ,Plugins etc to do automatic garbage collection in Delphi for win32
You can use interfaces for doing such garbage collection.
If you use interfaces and not classes, you don't have to put an explicit try...finally block, with a call to the free method in the finally section. The compiler will generate it for you, just like with regular string methods.
You can extend this trick to every object, with code like the one published in http://edn.embarcadero.com/article/28217
But this won't be a full garbage collector, like in java or DotNet. It's only reference counting.
IMHO full garbage collector is evil. Managing memory is not difficult in Delphi. You'll type a little more, but in all cases, the performance and global memory consummation will be better with no garbage collector.
There is API for Boehm Garbage Collector for Delphi. But it will work only on Delphi <=7 and without FastMM.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With