What the data area where JVM runtime

From "in-depth understanding of the Java Virtual Machine"

Here Insert Picture Description

1. thread shared data area

1.1 Method zone

Also known as Non-Heap, belonging to the respective common thread, class information storage has been loaded, constants, static variables, the instant compiled code, as well as runtime constant pool .

  1. JDK1.2 ~ JDK1.6 Hotspot implemented method of generation of a permanent area.
  2. JDK1.7 start permanent removal generations, the symbol table is moved to the Native Heap, strings and class references are moved to the Java Heap.
  3. JDK1.8 replaced with metaSpace.

1.2 heap memory

Java Heap, the largest piece of JVM memory management, storage with essentially all of the instances of objects. The main area is the management of GC.

  1. Java heap and the new generation into the old generation, or Eden, From Survivor, To Survivor.
  2. Java heap can not be in contiguous memory space on the physical.
  3. It may be divided into multiple threads private allocated buffer.

2. Thread the isolation of the data area

2.1 Java Virtual Machine stack

Java virtual machine thread stacks belong to private life cycle and thread the same time the implementation of each method will create a stack frame, used to store information local variable table, the operand stack, dynamic linking, method exports.

  1. Local variable table: storing the basic types of known compilation of reference type, returnAddress (pointing to the address of a byte code instruction). long and double take two types of local variable space data, other types use only one.
  2. Space required even local variable table has been determined at compile time, not change the size of the local variable table during the process operation.

2.2 native method stacks

Similar to the native method stacks and stacks of virtual machine role, Java virtual machine stack execution of the Java method (bytecode), native method stacks for Native method services.

Some virtual machines to virtual machines and native method stacks stack merged.

2.3 Program Counter

A small memory space, the current thread bytecode executed by the line number indicator. Multi-threaded Java Virtual Machine is in turn switched and allocated processor execution time achieved by a thread.

Published 56 original articles · won praise 3 · Views 1191

Guess you like

Origin blog.csdn.net/qq_40788718/article/details/103172169