Alex Rivera | Logout

Any way to "reboot" the JVM?

Asked 2008-11-03T17:20:05.477
35

Is there any way to reboot the JVM? As in don't actually exit, but close and reload all classes, and run main from the top?

Edit
Report

2 Answers

7

IBM's JVM has a feature called "resettable" which allows you to effectively do what you are asking.

http://publib.boulder.ibm.com/infocenter/cicsts/v3r1/index.jsp?topic=/com.ibm.cics.ts31.doc/dfhpj/topics/dfhpje9.htm

Other than the IBM JVM, I don't think it is possible.

answered 2008-11-03T18:08:56.547
0

AFAIK there is no such way.

Notice that if there were a way to do that, it would highly depend on the current loaded code to properly release all held resources in order to provide a graceful restart (think about files, socket/tcp/http/database connections, threads, etc).

Some applications, like Jboss AS, capture Ctrl+C on the console and provide a graceful shutdown, closing all resources, but this is application-specific code and not a JVM feature.

answered 2008-11-03T18:07:09.203

Your Answer