There is no garbage collection in Delphi, not at all. You need to allocate memory in heap and take care of deallocation yourself. You got some assistance in this with certain types, such as Delphi strings and interfaces.
To learn how to do it all with Delphi, you have to… learn Delphi, first of all, all the language and its semantic, as well as the general principles of heap, pointers and memory management in general. You can get some idea if you start, say, with this short article:
http://delphi.about.com/od/oopindelphi/a/memoryleak.htm[
^].
See also:
http://delphi.about.com/od/toppicks/tp/aatpmemleak.htm[
^].
I personally used MemCheck, it's very useful.
—SA