Why doesn’t the JVM cache JIT compiled code?

Without resorting to cut’n’paste of the link that @MYYN posted, I suspect this is because the optimisations that the JVM performs are not static, but rather dynamic, based on the data patterns as well as code patterns. It’s likely that these data patterns will change during the application’s lifetime, rendering the cached optimisations less than optimal.

So you’d need a mechanism to establish whether than saved optimisations were still optimal, at which point you might as well just re-optimise on the fly.

Leave a Comment