From: Justin Johnson Date: 2002-07-04T03:54:01+09:00 Subject: Re: Ruby implementation Q's > Well, how do other languages implement GC? Which language, in your opinion, > has the *best* form of garbage collection? I only know a little bit about > GC, and then only with regards to Perl and Ruby. I have no idea how C, C++, > Java, Smalltalk, OCaml, Lisp, etc handle GC behind the scenes. Perl and Python use reference counting in combination with a mark-and-sweep to reclaim cyclic reference garbage. C and C++ have only manual allocation/destruction by default but libraries are available to provide various flavours of garbage collection. Not sure about Java GC, but it runs on a seperate thread as an incremental (mark-and-sweep?) process. Generational garbage collectors are popular with Smalltalk and Lisp, although historically both have used reference counting. BETA uses the train algorithm, a twist on generational collecting. There are many, many variations and mixtures. It's quite a diverse field. Which ones are actually better largely depends on the implementation details and tuning. -- Justin Johnson justinj@mobiusent.com Technical Director Mobius