• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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
 
He's my best friend. Not yours. Mine. You can have this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic