aspose file tools*
The moose likes Distributed Java and the fly likes DGC Question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "DGC Question" Watch "DGC Question" New topic
Author

DGC Question

Karthik Guru
Ranch Hand

Joined: Mar 06, 2001
Posts: 1209
When we have a remote server object that extend UnicastRemoteObject, it waits for clients to connect to it instead of exiting.
If the count of client references to the remote object reduces to zero, the server object is eligible for GC??
if that is so the thread exits because the server object w'd b GCed?
I hope if i run System.gc() in my unrefereced method, the remote object will be GCed??
Does my registry hold on to the remote object reference in some way?? if that is the case do i need to call unbind() on the remote object?
am
Charlie Hubbard
Greenhorn

Joined: Apr 30, 2002
Posts: 6
Originally posted by karthik Guru:
When we have a remote server object that extend UnicastRemoteObject, it waits for clients to connect to it instead of exiting.
If the count of client references to the remote object reduces to zero, the server object is eligible for GC??
if that is so the thread exits because the server object w'd b GCed?

I hope if i run System.gc() in my unrefereced method, the remote object will be GCed??
Does my registry hold on to the remote object reference in some way?? if that is the case do i need to call unbind() on the remote object?
am

RMI Registry counts as one client so if you have an RMI object that exists in the RMI registry then it will not be GC'ed. Doing an unbind() will remove that object from the RMI registry and allow it to be GC'ed after all clients drop their remote references to it.
charlie
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: DGC Question