Over a million developers have joined DZone.

JVM Run-Time Data Areas

· Java Zone

Discover how AppDynamics steps in to upgrade your performance game and prevent your enterprise from these top 10 Java performance problems, brought to you in partnership with AppDynamics.

This is my note of reading JVM specification. I draw a diagram which helps me understand.

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: it is used to control each execution of each thread.
 
JVM Stack: It contains frames which is demonstrated in the diagram below.

Native Method Stack: it is used to support native methods, i.e., non-Java language methods.  

2. Date Areas shared by All Threads

All threads share Heap and Method Area.

Heap: it 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: it stores run-time constant pool, field and method data, and methods and constructors code。 

Runtime Constant Pool: It 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.

The Java Zone is brought to you in partnership with AppDynamics. AppDynamics helps you gain the fundamentals behind application performance, and implement best practices so you can proactively analyze and act on performance problems as they arise, and more specifically with your Java applications. Start a Free Trial.

Topics:

Published at DZone with permission of Ryan Wang. See the original article here.

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}