0

Before I begin, let me say that this may be the most absurd question ever asked here, because I've never even heard of anything like this to know if it's remotely possible. That said, if it is possible, I'd like to find out how I can do it.

I am running a Java program and I want to be able to save it and restore from the save later, to reduce startup time.

The application state at the time of saving would not yet have been burdened down by multiple processes and users, but it would be ready to listen for new users as soon as it is restored.

How can I

  • Save the application and all of its used memory
  • Load the entire application later, right where it left off

Or is this even possible? From what I know of computer hibernation, something similar is done; the data saved in RAM is written to the disk and loaded later, but I don't know if it's possible on a server or even a PC.

  • 1
    For a very simple application, you might be able to simply [serialize](https://docs.oracle.com/javase/tutorial/jndi/objects/serial.html) it into a file. If your application is more complex (containing non-serializable objects), you may need to use a serialization framework like Dozer or Kryo. – Mick Mnemonic Aug 22 '15 at 21:41
  • @MickMnemonic, "...save later, to reduce startup time." Serializing it won't help with that. – Emz Aug 22 '15 at 21:46
  • You can't really say that without knowing the application; if startup from scratch involves heavy calculations, then restoring from a serialized state will definitely help. – Mick Mnemonic Aug 22 '15 at 21:51
  • 2
    Most likely you could reduce startup time by optimizing what it's currently doing more easily than by saving a memory snapshot. – durron597 Aug 22 '15 at 21:58
  • The application startup indeed does involve heavy calculations, and reading and saving files into memory. I am not the developer of the software so I'm limited by both that and my knowledge of Java programming. I was hoping for a more 'freestanding' application that can save the program state independently without having code in the software to do so. – A.J. Ruckman Aug 23 '15 at 12:44
  • **I've found what I'm looking for, but I can't find good documentation on how to use it.** http://criu.org/Main_Page In testing on my laptop, I get 'Dumping FAILED' with multiple arguments. – A.J. Ruckman Aug 23 '15 at 13:56

0 Answers0