• 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

rmi objects are garbage collecting

 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi every body
as soon as am starting my applications and which creates remote references
through rmi it is giving that the server object is not having any remote reference.

i found no references
>by implementing the unreferenced interface


my dbts are:

>java.rmi.dg.leaseValue is 10 mins by default
i increased this value and tried hold references but no use
>but when i do above using the simple dummy interface it is working fine
but not in my application
>i didn't override this varibale any where in my application

can any body suggest me wt could be the problem?
 
Ranch Hand
Posts: 291
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There are two things you need to do to keep the garbage collector at bay:

1. Keep a live reference to the remote reference.
2. Keep the main Class alive.


1. Make sure the start up class always holds a live reference to the implementation class. Don't just export the remote object. Keep a live reference to it.

2. Never end the server:


// object for monitor
Object forever = new Object();

// lock object
synchronized (forever) {

try {
// wait forever
forever.wait();

} // end-try

catch (InterruptedException e) {
} // end-catch
} // end-sync
 
reply
    Bookmark Topic Watch Topic
  • New Topic