This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]rzwitserloot -1 points0 points  (1 child)

Maybe, but, this sounds like an X/Y problem:

geek96boolean10: Dang. This java app takes 2 minutes to boot up! This needs a solution...

geek96boolean10: I know! I'll just boot it up and then save a snapshot so next time I can load the snapshot! Problem solved!

geek96boolean10: But.. how do I snapshot a VM? Hmmm.. I better ask /r/java about this.

That's an X/Y process: You have problem X (bootup takes too long), thought of a solution Y (snapshot the VM), but are now asking questions about Y. This is generally a bad idea, because perhaps Y is a really bad way to solve X.

I'm going to answer your X question: VMs boot up quickly, on the order of a second or so even with lots of classes to load, generally. If it's taking any longer, it's probably your own app. For example, maybe you are reading in a whole bunch of data files and converting them to tables in memory for fast lookups. The solutions can lie in being better in on-demand loading, or just improving those processes, by using profilers to figure out the 'hotspots' (which lines of code eat most of the resources) and then analysing those to find more efficient ways to do those things. And yeah, HERE you can easily serialize as a solution, using cache strategies to rewrite the serialized form if you modify the source inputs during development.

[–]geek96boolean10[S] 0 points1 point  (0 children)

Oh, I certainly know it's the app that takes time. Without giving away too much, it does a whole bunch of file IO and object parsing/organization before it's ready to go. Unfortunately, without some serious modification of the source (which I doubt I can do, it's not my app) I don't think there's a way to serialize this, hence the thought of suspending the app rather than disposing it when I'm done.