Correct way of avoiding a shutdown delay caused by the Reaper thread
Greg Luck <[email protected]> Sat, 5 Aug 2006 16:53:30 +1000
| Newsgroups | gmane.comp.java.sun.rmi |
|---|---|
| Message-ID | <[email protected]> |
Hi I am, and it appears many others have had, trouble with RMI when trying to shutdown a JVM. The issue is that the Reaper thread is not a daemon thread and does not complete until the GC controlled by sun.rmi.dgc.client.gcInterval has been run. Because this interval is 60 seconds it causes an unacceptably long time to shutdown. The fix that I have seen out there is to call Runtime.getRuntime().gc(); The problem with that is that it is fairly common for java to be started with XX:+DisableExplicitGC. Indeed it is a best practice. See http://docs.sun.com/source/819-0084/pt_tuningjava.html. So, I am wondering if their is a best practice for avoiding the Reaper thread issue. The other idea I had was to set the sun.rmi.dgc.client.gcInterval to 1 second, but I am unsure what problems that may cause. Regards Greg Luck web: http://gregluck.com skype: gregrluck yahoo: gregrluck mobile: +61 408 061 622 =========================================================================== 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