• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

DGC Question

 
Ranch Hand
Posts: 1209
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
You got style baby! More than this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic