Table of contents
4 Supplement Tomcat to break the parental delegation mechanism
Before talking about the creation of java, let's first understand the memory composition of the Java virtual machine. When the Java virtual machine is started, the space allocated by the system to the JVM will be logically divided into heap, virtual machine stack, local method stack, method area, and program The counter has five parts, as shown in the figure below:
Heap : place new objects and arrays
Virtual machine stack : Before the thread runs, a thread stack space will be allocated to it. Each method execution in the thread will generate a stack frame and put it in the thread stack. The stack frame contains local variable tables, operand stacks, dynamic connections and methods. Export four parts.
Local variable table: store local variables in methods
Operand stack: data used for assignment or calculation
Dynamic link: the entry address of the method execution
Method exit: returns the address of the calling method
Local method stack : similar to the virtual machine stack, it is a stack for calling non-java methods
Method area : store class meta information, constant pool
Program Counter : Points to where the thread is running