JVM Run-Time Data Areas

The following are my notes of reading JVM specifications.

JVM runtime data area

1. Data Areas for Each Individual Thread (not shared)

Data Areas for each individual thread include program counter register, JVM Stack, and Native Method Stack. They are all created when a new thread is created.

Program Counter Register is used to control each execution of each thread.
JVM Stack contains frames which is demonstrated in the diagram below.
Native Method Stack is used to support native methods, i.e., non-Java language methods.  

2. Data Areas Shared by All Threads

All threads share Heap and Method Area.

Heap is the area that we most frequently deal with. It stores arrays and objects, created when JVM starts up. Garbage Collection works in this area.

Method Area stores run-time constant pool, field and method data, and methods and constructors code.

Runtime Constant Pool is a per-class or per-interface run-time representation of the constant_pool table in a class file. It contains several kinds of constants, ranging from numeric literals known at compile-time to method and field references that must be resolved at run-time.

JVM Stack

Stack contains Frames, and a frame is pushed to the stack when a method is invoked. A frame contains local variable array, Operand Stack, Reference to Constant Pool.

For more information, please go to the offical JVM specification site.

1. JVM Specification - Run-Time Data Areas
2. Java Bytecode Fundamentals

Category >> Diagram >> JVM/Compiler >> Memory  
If you want someone to read your code, please put the code inside <pre><code> and </code></pre> tags. For example:
String foo = "bar";

  1. Alvin YANG on 2014-9-11

    Great note to overview JVM architecture

  2. rasika90 on 2014-9-21

    Simple and very expressive. How about incorporating PermGen?

  3. Ning Guo on 2014-12-2


  4. asdfasdf on 2015-1-13

    You must improve your English.

Leave a comment