From: wvdbos@... Date: 2005-04-08T22:13:54+09:00 Subject: Re: ruby 1.8.3 preview1 plan --=_alternative 0048DF00C1256FDD_= Content-Type: text/plain; charset="US-ASCII" Did you look at the GC problem I wrote about some time ago? In case the message is gone here it i again: I tried the following script: #==================== class Example end a=Example.new ObjectSpace.each_object(Example) { |e| print e,"\n" } a=nil GC.enable GC.start ObjectSpace.each_object(Example) { |e| print e,"\n" } #==================== Output: # # The Example object is still active after the GC.start, I expected it to be gone. :-( So I tried the WeakRef, and this also did something strange. I wrote the 'Programming Ruby' book example: #==================== require "weakref" ref = "fol de rol" puts "Initial object is #{ref}" ref = WeakRef.new(ref) puts "Weak reference is #{ref}" ObjectSpace.garbage_collect begin puts "But then it is #{ref}" rescue Exception=>e puts e end #==================== Output: Initial object is fol de rol Weak reference is fol de rol Illegal Reference - probably recycled And this worked ok. I then copied the whole and just defined a class in between: #==================== require "weakref" ref = "fol de rol" puts "Initial object is #{ref}" ref = WeakRef.new(ref) puts "Weak reference is #{ref}" ObjectSpace.garbage_collect begin puts "But then it is #{ref}" rescue Exception=>e puts e end # # doing it for the second time, and created a class definition # and now it doesn't work # class Example end # ref = "fol de rol" puts "Initial object is #{ref}" ref = WeakRef.new(ref) puts "Weak reference is #{ref}" ObjectSpace.garbage_collect begin puts "But then it is #{ref}" rescue Exception=>e puts e end #==================== Output: Initial object is fol de rol Weak reference is fol de rol Illegal Reference - probably recycled Initial object is fol de rol Weak reference is fol de rol But then it is fol de rol And this is strange the second 'ref' is not collected. If the class definition is removed all works well. I tested this in the mswin32 version. 1.8.2 and in the older version 1.6.8 both with the same results. The cygwin version 1.8.2 had the same results also. To be sure I the downloaded 1.9.0 and this also went wrong. It looks like the Garbage Collector is not working properly. Can anybody help. Thanks. Wim... Yukihiro Matsumoto 07-04-2005 07:03 Please respond to ruby-core@ruby-lang.org To ruby-core@ruby-lang.org cc Subject ruby 1.8.3 preview1 plan Hi, I am going to release 1.8.3 preview1 on April 12, unless something would stop me. Core contributors who want to update their libraries for 1.8.3, please consider updating your code before preview1. And someone who found bugs for 1.8 CVS, please report here. matz. --=_alternative 0048DF00C1256FDD_=--