2.2 Run-time area
A Java Virtual machine is divided into several different data regions,
1. Program counter, the bytecode interpreter is working by changing the value of the counter to take a scare jump. The bytecode command to execute
Understanding the String.intern () method
Function: If a string constant in the pool contains a string equal to this string object, the strings represented in the pool are returned, otherwise the string containing the object is added to the constant pool and a reference to this string object is returned.
Actual combat
Set the minimum-xms parameter of the heap to the same as the maximum-xmx parameter to prevent the heap from automatically expanding through the parameters-xx:+ Heapdumponoutofmemoryerror allows the virtual machine to dump the current memory heap dump snapshot for subsequent analysis when a memory overflow exception occurs
Java heap Memory Oom exceptions are common and occur when Java.lang.OutOfMemoryError:Java heap space is used to analyze memory overflows using Eclipse Memory analyzer
Recursive, easy to appear stackoverflowerror
Method area and run time zone test ideas: The runtime generates a large number of classes to fill the method area until overflow. CGLIB Create classes, generate Classcode to do, common with a large number of JSP or dynamically generated JSP file application
Eclipse Memory Analyzer uses
- The questions to understand later
- Understanding the String.intern () method
- Eclipse Memory Analyzer uses
- The relationship between the JDK and the virtual machine
- How to view GC logs
In-depth understanding of Java Virtual Machine learning notes Chapter II Java memory area and memory overflow exception