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. Ext.Ajax.request同步请求

    导读: ajax分为2种,一种是同步,一种是异步同步:代码执行完了之后才执行后面的代码 异步:代码刚执行,后面的代码就马上接着执行了,不管前面的代码是否执行完异步的情况下,要获得返回信息,就需要在异步 ...

  2. mysql中TimeStamp和Date的转换

    mysql 查询时间戳(TIMESTAMP)转成常用可读时间格式 from_unixtime()是MySQL里的时间函数 date为需要处理的参数(该参数是Unix 时间戳),可以是字段名,也可以直接 ...

  3. 程序员欢呼:微软Bing开始支持搜索源码、可直接运行!

    日常生活中,程序员们经常会遇见这样那样的问题,比如忘记了代码该怎么写,又或者需要实现一些特殊的算法和功能.这时候,你就可以去找微软 Bing 帮忙啦! 微软最近联合 HackerRank 一起研发了一 ...

  4. Web Services的相关名词解释:WSDL与SOAP

    在对Web Services进行性能测试时,接触到最多的两个名词就是WSDL和SOAP.利用LoadRunner对Web Services进行调用的时候,也存在两种常用方法,即基于WSDL的[Add ...

  5. 基于Processing的数据可视化

    虽然数据可视化领域有很多成熟.界面友好.功能强大的软件产品(例如Tableau.VIDI.NodeXL等),但是借助Processing我们可以基于Java语言框架进行丰富多元的可视化编程,熟悉了Pr ...

  6. Asp.Net MVC4新特性指南(1): 基本介绍

    这段时间项目不紧,没啥事,就琢磨着把MVC4了解下.看看有啥新特性,顺便发表个博文记录下.哈哈. MVC4我们就用到了微软的Visual Studio 2012(http://www.microsof ...

  7. EasyWebServer编写CGI程序的环境变量

    示例: SERVER_SOFTWARE=EasyWebServer/1.9 SERVER_PROTOCOL=HTTP/1.1 SERVER_PORT= SERVER_NAME=aozima-noteb ...

  8. openStack云平台虚拟桌面galera mysql 3节点集群实例实战 调试完成

    被复制节点: /usr/local/mysql/bin/mysqld_safe --wsrep_cluster_address=gcomm:// >/dev/null &复制节点01: ...

  9. reids-geo

    Redis Geo Geo

  10. 创建maven项目出现的问题

    右击项目无法显示maven图标,创建的pom.xml无法识别,并且创建maven项目时,一直显示Loading archetype list...