jvm——CodeCache

https://juejin.im/post/5c890f21f265da2d993dc692

CodeCache is hot staging area code, through time compiler to compile code will be placed here, it exists in the external heap memory.

Internal JVM will first try to explain Java byte code execution when a method call or loop back to edge up to a certain number of times, trigger-time compilation, compiled Java bytecode to native machine code to improve the efficiency. The compiled native machine code is cached in CodeCache is, if there is a lot of code to trigger the in-time compiler, and there is no timely GC, then, CodeCache will be filled.

Once CodeCache is filled, the code has been compiled to native code will execute mode, but no later compiled code can only run as interpreted execution.

By comparing the second measure, the performance difference can be seen interpreted and compiled execution of clarity. So for most applications, this situation is catastrophic.

JVM GC provides for CodeCache way: -XX: + UseCodeCacheFlushing. This parameter is enabled by default after JDK1.7.0_4, when about to fill CodeCache will try to recover. JDK7 recovery in this area do not rarely, GC lower earnings in JDK8 has been greatly improved, so you can JDK8 directly improve performance in this area by upgrading to.
Provides a JVM startup parameters in Java8: -XX: + print usage CodeCache when PrintCodeCache, he can stop the JVM, you can look at this values ​​each time the application is stopped, slowly adjust to the most appropriate size.

Guess you like

Origin www.cnblogs.com/gaoquanquan/p/10936398.html
JVM
JVM