首页 > 代码库 > jvm 数据区划分学习

jvm 数据区划分学习

Java virtual machine 运行时数据存储区域划分

2015年1月25日

19:15

  • Pc  寄存器

Each Java Virtual Machine thread has its own pc (program counter) register. 

每一个jvm线程都拥有自己的pc 寄存器。

源文档 <http://docs.oracle.com/javase/specs/jvms/se7/html/jvms-2.html#jvms-2.5>

 

the pc register contains the address of the Java Virtual Machine instruction currently being executed.

寄存器里保存了当前正在被执行的jvm指令的地址。

源文档 <http://docs.oracle.com/javase/specs/jvms/se7/html/jvms-2.html#jvms-2.5>

 

  • Jvm stackjvm 栈)

Each Java Virtual Machine thread has a private Java Virtual Machine stack, created at the same time as the thread. 

每个jvm线程都拥有一个自己的jvm栈,在线程创建的时候创建。

源文档 <http://docs.oracle.com/javase/specs/jvms/se7/html/jvms-2.html#jvms-2.5>

 

  • Heap (堆)

The Java Virtual Machine has a heap that is shared among all Java Virtual Machine threads. The heap is the run-time data area from which memory for all class instances and arrays is allocated.

jvm的堆是被所有线程所共享的,堆是运行时数据分配类实例对象和数组的内存空间。

源文档 <http://docs.oracle.com/javase/specs/jvms/se7/html/jvms-2.html#jvms-2.5>

 

The heap is created on virtual machine start-up. Heap storage for objects is reclaimed by an automatic storage management system (known as a garbage collector)

 

源文档 <http://docs.oracle.com/javase/specs/jvms/se7/html/jvms-2.html#jvms-2.5>

 

  • Method area (方法区)

The Java Virtual Machine has a method area that is shared among all Java Virtual Machine threads.

方法区被所有线程共享

The method area is created on virtual machine start-up. Although the method area is logically part of the heap,

 

源文档 <http://docs.oracle.com/javase/specs/jvms/se7/html/jvms-2.html#jvms-2.5>

 

  • 运行时常量池

Each run-time constant pool is allocated from the Java Virtual Machine‘s method area (§2.5.4). The run-time constant pool for a class or interface is constructed when the class or interface is created (§5.3) by the Java Virtual Machine.

运行时的常量池是方法区的一部分,它是在jvm创建一个类或者是接口时生成的。

源文档 <http://docs.oracle.com/javase/specs/jvms/se7/html/jvms-2.html#jvms-2.5>

 

  • 本地方法区 native method stack

An implementation of the Java Virtual Machine may use conventional stacks, colloquially called "C stacks," to support native methods (methods written in a language other than the Java programming language).

 

本地方法区通常是使用传统的栈来调用用其他语言编写的本地方法。

源文档 <http://docs.oracle.com/javase/specs/jvms/se7/html/jvms-2.html#jvms-2.5>

 

技术分享

技术分享

 

jvm 数据区划分学习