Start / Stop JVM

Possible duplicate:
Are there any Java virtual machines that can save their state in a file and then reload this state?

Is there a way to stop the JVM, save its state on the hard drive, and resume execution from the point where it was stopped? Something like hibernating windows, linux, etc.

+4
source share
1 answer

When it runs on Unix, you can, of course, pause it, for example. by pressing "^ Z" on the command line you started it with, or by sending a SIGSTOP signal. This is not exactly what you want. It is not written directly to the disc (although it can be replaced). It will not survive a system reboot. Unlike an image file, you cannot copy or restore it.

There are also various hacks that allow some image-based systems (smalltalk, emacs, etc.) to "unexec ()" themselves and save a copy to disk. They break any network connections or open files. Most approaches also require collaboration with a program that will be retained, especially in order to gracefully handle communications with an external secret.

Finally, you can start the JVM in the virtual machine and pause the virtual machine. There, at least, file connections inside the virtual machine will be saved.

+2
source

All Articles