From: Roger Pack Date: 2008-08-01T14:18:41+09:00 Subject: Re: gc doesn't collect? Just to clear up confusion: I believe that GC.start 'forces' a garbage collection, and that do...end and {...} scopes do indeed have their own scope and local variables, as methods do. interestingly, def go 1.times { a = 'a'*1000}; end go 30.times { GC.start }; print ObjectSpace.each_object{|o| print o} yields the same errant results. I might look into it sometime. Very weird. Now for some questions: currently the GC marks live objects then sweeps to find any free objects--except it doesn't actually free any objects that are free but need finalization. It seems to only do finalizations when a user explicitly calls GC.start, or when the program terminates. Is there a reason for this 'deferred_final_list' activity? Also is it true that objects marked FL_SINGLETON should never be freed, even if they are no longer referenced by any live code? Or is FL_SINGLETON just used as an internal GC marker to mean 'the heap this object comes from is entirely free--don't bother adding it to the freelist since it is on the chopping block to be free'ed' and nothing else? Thanks! -R -- Posted via http://www.ruby-forum.com/.