evanwebb / gmail.com wrote:
> Not a bug in any way. It's simply that the garbage collector has not
> been trigger. It runs only when it needs to. As you realized you, you
> can force it to run by doing 'GC.start'. If you run 'GC.start' at the
> end of your program, you'll see the memory reclaimed.
> 
> This is a typical behavior for a mark/sweep garbage collector. Perl
> and Python are reference count, freeing memory the instant it goes out
> of scope. Ruby waits to free memory until it needs memory to free some.

Yes, I agree. I analyzed source code of gc.c. GC was triggered each time 
when malloc_increase reach malloc_limit. Variable malloc_limit was 
increased by factor proportional to (malloc_increase - malloc_limit). In 
each loop cycle malloc_increase > malloc_limit because malloc_increase 
is sum of arithmetic series of string length between GC calls.

-- 
Posted via http://www.ruby-forum.com/.