From: Eric Hodel Date: 2014-01-16T13:43:17-08:00 Subject: [ruby-core:59810] Re: About unmarshallable DRb objects life-time On 16 Jan 2014, at 02:15, Rodrigo Rosenfeld Rosas wrote: >> The above matters especially so for objects that you extend with DRbUndumped. This means you must keep the object alive where you create it or the GC will throw it away when no references remain. > > Thank you, this confirms my suspicion. Unfortunately it's not feasible to create a generic proxy to the JVM from MRI through DRb and JRuby as I first thought it would be. It would be the case if DRb was responsible for translating any references in the DRb client-side as another local reference in the server-side so that those objects wouldn't be collected by GC. In that case it should also be responsible for removing the local references as the counterpart in the DRb client goes away. > > But maybe this is too hard to implement, so I'll give up on the generic MRI-JVM bridge by using DRb. I'll try to update my article soon to explain what I found and stop recommending that approach. As I noted in my email (not quoted in this reply) you can use id conversion to provide a way to keep local references alive. DRb doesn�t provide a generic way to do this as there is not a one-size-fits-all solution to this problem. You could try an id converter that combined an LRU of a reasonable size along with the ability to recreate local objects for items that fall off the LRU.