Serialize HotSpot Status

What are the technical reasons why it was not possible to save some kind of JVM image after it was warmed up? Assuming I want to resume work on the same platform (so that any JIT stuff will work).

+5
source share
1 answer

Depending on which JVM you use, there is such functionality already. JRockit said it could , for the "normal" consumer, JRE a JEP 145 existed, but obviously did not.

There are several questions on this topic already here on SO, try this one .

For a regular Oracle JVM, such a function does not exist, you can play with CodeCache so that it compiles functions as soon as possible, or "warm up" your JVM.

A stored JVM cache carries some risks, such as, for example, with all caches. The JIT state will need to be nullified and recounted when your code changes. If this does not happen, you will run your program with the old code. This, apparently, is the main reason this cache drive remains limited by the “professional” JVM. Also, the JIT optimization that occurs during startup is considered fast enough to be repeated every time it starts, thereby eliminating the risk of running with outdated code.

+6
source

Source: https://habr.com/ru/post/1233490/


All Articles