Delphiのガーベジコレクション

Delphiって、てっきり、ガーベジコレクションしている言語だと思っていたのですが、ビルトインタイプのみガーベジコレクションしているだけで、オブジェクトについてはガーベジコレクションしてくれていないんですね。

Answers - The Most Trusted Place for Answering Life's Questions
Delphi
A language that uses reference counting for garbage collection is Delphi. Delphi is not a completely garbage collected language, in that user-defined types must still be manually allocated and deallocated. It does provide automatic collection, however, for a few built-in types, such as strings, dynamic arrays, and interfaces, for ease of use and to simplify the generic database functionality.
Some of the reasons reference counting may have been preferred to other forms of garbage collection in Delphi include:

  • The general benefits of reference counting, such as prompt collection.
  • Cycles either cannot occur or do not occur in practice using only the small set of garbage-collected built-in types.
  • The overhead in code size required for reference counting is very small, and no separate thread of control is needed for collection as would be needed for a tracing garbage collector.
  • Many instances of the most commonly used garbage-collected type, the string, have a short lifetime, since they are typically intermediate values in string manipulation.
  • Because garbage-collection is only done on built-in types, reference counting can be efficiently integrated into the library routines used to manipulate each datatype, keeping the overhead needed for updating of reference counts low.