This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

DGC Question

 
Karthik Guru
Ranch Hand
Posts: 1209
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic