From: Eric Hodel Date: 2004-09-23T10:47:09+09:00 Subject: Re: DrbUndumped and GC -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Sep 22, 2004, at 6:14 PM, Ara.T.Howard wrote: > > if one has a drb server that returns objects extended by DrbUndumped > to the > client, how is garbage collection done? eg. > > class Proxy > include DrbUndumped > end > > class Server > def method > return Proxy::new > end > end > > so the client will have a handle on the Proxy, and so will the client. > how > will the server know when the client no longer needs the handle and gc > the > object? POLS says the object would be gc'd in the client as normal > and that > this would trigger the gc on the server. but what if more than one > client has > a handle on the server side proxy? now we are reference counting > across > remote nodes. my gut says this could get one in trouble quickly if > many > DrbUndumped objects were being returned to many clients, or even if a > single > DrbUndumped object was returned to many clients... Nope, DRb is not that smart by default. Your Proxy instance is immediately available for garbage collection. You want to use a different IdConv class to ensure objects don't get GC'd before they're supposed to, or don't get GC'd until your clients are done using them. > i'm about to dig into the code and run some tests to see - but am > hoping some > of you drb experts out there may already have done this ;-) http://segment7.net/projects/ruby/drb/idconv.html Shows how the various id conversion classes work with DRb, letting you control how and when objects get GC'd. A ref-counting IdConv would be a nifty add-on to DRb. - -- Eric Hodel - drbrain@segment7.net - http://segment7.net All messages signed with fingerprint: FEC2 57F1 D465 EB15 5D6E 7C11 332A 551C 796C 9F04 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (Darwin) iD8DBQFBUiyBMypVHHlsnwQRAp6RAKChVFS1p/Jq9VsJP/4d9hSrTwpxOgCg+jIr bd29ZmT7uWNGWxdPkvULt7M= =E8n6 -----END PGP SIGNATURE-----