From: Brian Candler Date: 2010-08-18T22:27:10+09:00 Subject: Re: Ruby GC question (MRI, JRuby, etc) Chuck Remes wrote: >> In any case, if you don't keep a reference to them somewhere, then you >> can never call any method on them, so the objects are obviously useless >> (which is why they are garbage-collected in the first place) > > Not necessarily true. The Bar class in my example could have its own > internal lifecycle where it is generating events for Baz and Quxxo Not unless it is running in its own thread. In that case, there will be a reference to the object held within the thread - for example in a local variable. However, if the object exists solely to be shared by DRb, then yes you will need to keep a handle to it to stop it being garbage-collected. That's because DRb uses _id2ref to locate objects via just their id. -- Posted via http://www.ruby-forum.com/.