Among all trolling subject in forums, you'll find out the
great Garbage Collection theme.
Fashion languages rely on it. At the core of the .Net and Java framework,
find a Garbage Collector. New developers, just released from schools, do
learn about handling memory only in theory, and just can't understand how is
memory allocated - we all have seen such rookies involved in Delphi code
maintenance, leaking memory as much as they type. In fact, most of them did not
understood how a computer works. I warned you this will be a trolling
And, in Delphi, there is no such collector. We handle memory in
- Creating static variables - e.g. on the stack, inside a
- Creating objects with
class instances allocated on heap - in
at least three ways: with a
try..finally Free block, with a
TComponent ownership model in the VCL, or by using
interface (which creates an hidden
- Creating reference-counted variables, i.e.
variant kind of
It is a bit complex, but it is also deadly powerful. You have several memory
allocation models at hand, which can be very handy if you want to tune your
performance and let program scale. Just like manual recycling at home will save
the planet. Some programmers will tell you that it's a waste of cell brain,
typing and time. Linux kernel gurus would not say so, I'm afraid.
Then came the big Apple company, which presented its new ARC model
(introduced in Mac OS X 10.7 Lion) as a huge benefit for
Objective-C in comparison with the Garbage Collection model. And
let's face it: this ARC just sounds like the Delphi memory model.