Run-time data area

Program Counter

​ Program Counter Register

Virtual machine in the conceptual model, when the bytecode interpreter is working by changing the value of the counter byte code to select a next instruction to be executed, a branch, looping, branching, exception handling, and other basic functions are thread recovery need to rely on this counter is complete.

Thread private, this area is the only one not specify any area OutOfMemoryError situation in the java virtual machine specification.

If the thread is executing a java method, the counter records the address of the virtual machine bytecode instruction being executed; if the method is being performed Native, this counter value is null (undefined).

java virtual machine stack

​ Java Virtual Machine Stacks

Also thread private, virtual machine stack memory model described Java method executed: while performing each method will create a stack frame (Stack Frame) for storing local variable table, the operand stack, dynamic linking method export and other information.

Native method stacks

​ Native Method Stacks

VM stack with similar effects, the difference between them is the native method stacks for virtual machines using the method of Native service.

Java heap

Java Heap

Java heap is shared by all threads of a memory area for the sole purpose of this virtual machine is stored object instance, almost all object instances are here to allocate memory.

Methods district

Method Area

The method area is also the thread shared memory area, which is used to store such information has been loaded virtual machine, constants, static variables, the code data in-time compilation. Many people also put a permanent method area called Generation (Permanent Generation)

Memory recovery of this area is mainly for recycling and unloading of constant pool types.

Runtime constant pool

Runtime Constant Pool region is part of the method. Class file versions in addition to the classes, fields, methods, and interface description information, the information is also a constant pool (Constant Pool Table), and for storing various literal compile generated reference symbols, this part the method of operation will enter the region after the class loading time constant storage pool.

发布了303 篇原创文章 · 获赞 112 · 访问量 38万+

Guess you like

Origin blog.csdn.net/u012326462/article/details/104219601