Re: RMI cleanup
mvanr <[email protected]> Thu, 30 Apr 2009 23:56:37 -0700
| Newsgroups | gmane.comp.java.sun.rmi |
|---|---|
| Message-ID | <[email protected]> |
Thanks for the suggestion. The java code that caused the problem runs almost entirely in a single thread, so I suspect there are threads at a lower level, within the RMI or IO classes that give rise to the high load. We use the retry mechanism to allow us to take RMI server down and back up without causing the client processes to die. So there were only about six client threads at the user level that caused the load to go up to almost 1000. I think what's happened here is that although the lookup call succeeded, the server was running with an explicit -Djava.rmi.server.hostname=mirror, and somehow this caused the exception on the client because "mirror" wasn't defined (in /etc/hosts in this case). I set the "remote" to null, expecting that the GC will notice the unused connection and finalize it. But I suspect that at a lower level this connection is somehow continuing to use resources and contributing to server load. Ideally there would be a nice clean way of telling RMI that a remote object in the client is no longer in use, but I don't know of any so for now I'm at the mercy of the GC. This is all on the client side. This was a production server, so when I figured out what was happening, I just defined the "mirror" in /etc/hosts, and the problem's gone away. To reproduce the problem, I will need to duplicate the problem in a development environment (which should be easy), but hopefully I will get some insights on how best to fix it first. I'll post the solution I use onto the list. Michael. -- View this message in context: http://www.nabble.com/RMI-cleanup-tp23310928p23329110.html Sent from the Java - RMI mailing list archive at Nabble.com. =========================================================================== To unsubscribe, send email to [email protected] and include in the body of the message "signoff RMI-USERS". For general help, send email to [email protected] and include in the body of the message "help". For a list of frequently asked RMI questions please refer to: http://java.sun.com/j2se/1.3/docs/guide/rmi/faq.html To view past RMI-USERS postings, please see: http://archives.java.sun.com/archives/rmi-users.html