river-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christopher Dolan" <christopher.do...@avid.com>
Subject RE: strange problem with DGC
Date Mon, 08 Mar 2010 15:47:55 GMT
Among our developers, this has become institutional knowledge: always
hold a reference to the service in a member field or as a local in a
main() method that never returns.

Another strategy we've used is to hold a reference to the service in a
Thread passed to Runtime.addShutdownHook().  That serves the dual
purpose of keeping the service from being GC'd and enabling last-minute
cleanup of a service that is not explicitly unregistered and unexported.
In our code, we also use a manual unregister() method on each service
that stops the JoinManager, unexports the service, and removes the
shutdown hook.  So, in this case the shutdown hook is a fail safe in
case of a developer bug.


-----Original Message-----
From: Peter Firmstone [mailto:jini@zeus.net.au] 
Sent: Sunday, March 07, 2010 6:15 AM
To: river-dev@incubator.apache.org
Subject: Re: strange problem with DGC

Hmm interesting, by default DGC is disabled and all exported Remote's 
are only referred to by a weak reference, unless the implementer holds a

strong reference, when using DGC (discouraged for secure endpoints due 
to DOS attacks) the service will have a strong reference kept, while 
client remote references leases exist. However if there's an intervening

period where there are no clients and no local strong reference the 
Remote object will be GC'd.

... <snip> ...

View raw message