From: Tridib Bandopadhyay Date: 2010-12-07T11:27:00+09:00 Subject: Re: Manual Memory Management and Automatic Garbage Collection Ammar Ali wrote in post #966575: > The GC_NOTIFY flag is not available in ruby 1.8, it's in 1.9 only. If > you have to use ruby 1.8, you can do it yourself by adding printf > calls at the begining an end of the rb_gc_start function in gc.c. > Under 1.9 the function where GC start is called gc_collect, or at > least that's where GC_NOTIFY is placed. > > Regards, > Ammar I tried in there also.Here is the code.-- rb_gc_start() { rb_gc(); return Qnil; printf("Hello!!") } It is compiling but is not showing the hello message when i am running the code.Here is my ruby code-- print "Please enter number 1 : "; val1 = gets; print "Please enter number 2 : "; val2 = gets; print "Answer : " , (val1.to_i + val2.to_i), "\n"; ct = 1; while(ct<100) a=[]; na = 0; while(na<1000) a[na]=na; na = na+1; end; print ct; ct=ct+1; end; How to see that hello message and how to know when Garbage Collector is doing its work. -- Posted via http://www.ruby-forum.com/.