Hi,

> Hello,
>
> I hope people do not mind that I have a followup question-
>
> from where is the garbage collector invoked in the interpreter?

Let me talk about trunk's GC because CRuby's GC adopts Lasy Sweep GC
since Ruby 1.9.3.

In many case, GC is invoked at following cases.

1. When the interpreter allocate some Ruby's object.
2. When you call GC.start in your Ruby programs.
3. When malloc_increase exceeds malloc_limit.

In 2. and 3. cases, GC executs mark and sweep atomically by using
garbage_collect() in gc.c.

In 1. and Ruby's heap don't have a unswept object cases, GC executs
mark and sweep that sweeps Ruby's heap until it finds an appropriate
free object.

In 1. and Ruby's heap has a unswept object cases, GC executs sweep
until it finds an appropriate free object.

Please see gc_lazy_sweep() in gc.c if you want to know a detail of
this process.

# And, you can see matt's great presentation for this topic.
# http://rubyconf11.merbist.com/#57

Thanks.
-- 
Narihiro Nakamura (nari)