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. Sed&awk笔记之awk篇

    http://blog.csdn.net/a81895898/article/details/8482333 Awk是什么 Awk.sed与grep,俗称Linux下的三剑客,它们之间有很多相似点,但 ...

  2. RH的NFS配置--简单OK

    参照文档: http://wenku.baidu.com/link?url=SAcDvj8WtBd8dunC7P6FTFADYYVzzxhOiNJqbgr-aGTZovM0lHg-wbYgv9I3Lu ...

  3. python乱码处理

    在.py文件第一行加上以下任意一种,只是写法不同,效果一样的. # -*- coding: UTF-8 –*- #vim: set fileencoding=utf-8: # coding=utf-8 ...

  4. .net 开源项目

    .NET开发人员值得关注的七个开源项目 [IT168技术分析]微软近几年在.NET社区开源项目方面投入了相当多的时间和资源,不禁让原本对峙的开源社区阵营大吃一惊,从微软.NET社区中的反应来看,微软. ...

  5. Google Map API 学习六-设置infoWindow的长宽

  6. 495. Kids and Prizes

    http://acm.sgu.ru/problem.php?contest=0&problem=495 学习:当一条路走不通,换一种对象考虑,还有考虑对立面. 495. Kids and Pr ...

  7. gcc编译器参数使用及解决

    gcc -c CStringAndPointer.c -o CStringAndPointer.o 执行时出现问题: ./CStringAndPointer.o bash: ./CStringAndP ...

  8. hdu 4405概率dp

    #include <cstdio> #include <cstring> #include <iostream> #include <cmath> #i ...

  9. linux平台MongoDB数据库安装

    跟Ruiy哥一起玩转吧; <一,初始化玩转MongoDB> 1,关闭SElinux(Ruiy哥根据经验知红帽的SElinux架设就是个错误,还记得不管啥结构首先要关闭的就是它); 2,设置 ...

  10. kafka配额控制

    转载请注明地址http://www.cnblogs.com/dongxiao-yang/p/5217754.html Starting in 0.9, the Kafka cluster has th ...