Ref:  JVM Run-Time Data Areas

 class SimpleThread extends Thread {
public SimpleThread(String name) {
super(name);
}
public void run() {
for(int i = 0; i < 50; i++) //every 'i' variable corresponds to an individual thread,that is,each thread contains its own 'i' variable.
println("thread name = \"" + Thread.currentThread().getName() + "\",id=" + getId() +" run = " + i);
}
}

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. Data 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 kind-s of constants, ranging from numeric literals known at compile-time to method and field references that must be resolved at run-time.

  

  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.

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

  

JVM Run-Time Data Areas.的更多相关文章

  1. Java Run-Time Data Areas

    前言 本文主要介绍JVM的运行时数据区 来自Oracle文档 Java Virtual Machine Specification -- Chapter 2. The Structure of the ...

  2. Java-JVM 运行时内存结构(Run-Time Data Areas)

    Java 虚拟机定义了在程序执行期间使用的各种运行时数据区域. 其中一些数据区域所有线程共享,在 Java 虚拟机(JVM)启动时创建,仅在 Java 虚拟机退出时销毁. 还有一些数据区域是每个线程的 ...

  3. JVM Run-Time Data Areas--reference

    http://www.programcreek.com/2013/04/jvm-run-time-data-areas/ This is my note of reading JVM specific ...

  4. 深入理解JVM内幕(转)

    转自:http://blog.csdn.net/zhoudaxia/article/details/26454421/ 每个Java开发者都知道Java字节码是执行在JRE((Java Runtime ...

  5. 深入理解JVM内幕:从基本结构到Java 7新特性

    转自:http://www.importnew.com/1486.html 每个Java开发者都知道Java字节码是执行在JRE((Java Runtime Environment Java运行时环境 ...

  6. JVM 内部原理(二)— 基本概念之字节码

    JVM 内部原理(二)- 基本概念之字节码 介绍 版本:Java SE 7 每位使用 Java 的程序员都知道 Java 字节码在 Java 运行时(JRE - Java Runtime Enviro ...

  7. JVM 内部原理(一)— 概述

    JVM 内部原理(一)- 概述 介绍 版本:Java SE 7 图中显示组件将会从两个方面分别解释.第一部分涵盖线程独有的组件,第二部分涵盖独立于线程的组件(即线程共享组件). 目录 线程独享(Thr ...

  8. Understanding JVM Internals---不得不转载呀

    http://www.cubrid.org/blog/dev-platform/understanding-jvm-internals/ http://architects.dzone.com/art ...

  9. JVM Guide

    Java Virtual Machine: the Essential Guide October 8th, 2014 - By Alexey Zhebel Introduction Java Vir ...

随机推荐

  1. Js 表单序列化

    http://www.w3cmm.com/javascript/serialize-form.html

  2. WINDOWS+L组合键锁定XP

    在Windows XP时工作时,我们经常要锁定计算机,当计算机被锁定后,只有重新登录才能够使用计算机,从而保证了计算机的安全. WINDOWS+L组合键锁定XP,就是键盘上右边的小窗口+L键 ,可以快 ...

  3. Android 自定义dialog(AlertDialog的修改样式)

    LayoutInflater inflater = LayoutInflater(AudioActivity.this); View timepickerview = inflater.inflate ...

  4. C++中的new/delete与operator new/operator delete

    new operator/delete operator就是new和delete操作符,而operator new/operator delete是函数. new operator(1)调用opera ...

  5. unicode随笔小计

    科普字符集: ascii:一个字节,占8位,(0000 0000 - 1111 1111) 如果只是英语那就没什么问题. 后来,不同的语言有了编码诞生.为了统一,出现一个大集合.便有了. unicod ...

  6. 选择排序(SelectSorted)

    //简单的选择排序public class SelectSorted { public static void main(String[] args) { int[] array={12,24,9,7 ...

  7. 数学常数e的含义

    转载:   http://www.ruanyifeng.com/blog/2011/07/mathematical_constant_e.html 作者: 阮一峰 日期: 2011年7月 9日 1. ...

  8. 什么要缓存curl资源

    在看公司的代码框架底层时,发现了一个问题,如下: 代码中调用接口时,使用的是curl,框架将curl资源以IP :端口的形式缓存了下来,例如: 10.10.10.10:80     curl1 10. ...

  9. Hibernate自定义数据库查询(排序、输出条数)

    Hibernate数据库操作类(eg:TexDAO.java) /* * queryString HQL语句,first开始条数, max输出条数 ,norder排序 * 例: List lis = ...

  10. ELK监控系统nginx / mysql慢日志

    ELK监控系统nginx / mysql慢日志 elasticsearch logstash kibana ELK监控系统nginx日志 1.环境准备 centos6.8_64 mini IP:192 ...