How does the distributed garbage collector detect a client that disconnects? Is it advisable to use System.exit for graceful client termination?
When the RMI runtime in a client VM detects that a remote object is no longer referenced locally, it asynchronously notifies the server relatively quickly so that the server can update the object’s referenced set accordingly. The distributed garbage collector uses a lease associated with each client-held remote object reference, and renews leases to remote objects while the client still holds such references. The purpose of the lease renewal mechanism is to allow the server to detect the abnormal termination of clients, so that a server does not hold on to a remote object forever because of a client that was not able to send the appropriate “unreferenced” message before it stopped running.
Related Questions
- How much slower will each instance of the Distributed Folding client in a dual-CPU computer run than a single instance of the Distributed Folding client on a single processor?
- How does the distributed garbage collector detect a client that disconnects? Is it advisable to use System.exit for graceful client termination?
- When is an object eligible for garbage collection by the Terracotta distributed garbage collector?