I can see the garbage collector coming when I type.

./ruby -e 'GC.start()'

But I want to know while a code is running the printf statement written 
by me should appear.

Is there any other code to make gc show my message.

This code is running for infinite time..but not showing the message.


i=1
while (true)
   puts "message #{i}"
   i+=1
end

What are the other ways?

I need to convince myself that when there is memory allocation the 
Garbage collector comes for cleaning with a printf statement stating its 
work.

Regards
Tridib

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