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.的更多相关文章
- Java Run-Time Data Areas
前言 本文主要介绍JVM的运行时数据区 来自Oracle文档 Java Virtual Machine Specification -- Chapter 2. The Structure of the ...
- Java-JVM 运行时内存结构(Run-Time Data Areas)
Java 虚拟机定义了在程序执行期间使用的各种运行时数据区域. 其中一些数据区域所有线程共享,在 Java 虚拟机(JVM)启动时创建,仅在 Java 虚拟机退出时销毁. 还有一些数据区域是每个线程的 ...
- 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 ...
- 深入理解JVM内幕(转)
转自:http://blog.csdn.net/zhoudaxia/article/details/26454421/ 每个Java开发者都知道Java字节码是执行在JRE((Java Runtime ...
- 深入理解JVM内幕:从基本结构到Java 7新特性
转自:http://www.importnew.com/1486.html 每个Java开发者都知道Java字节码是执行在JRE((Java Runtime Environment Java运行时环境 ...
- JVM 内部原理(二)— 基本概念之字节码
JVM 内部原理(二)- 基本概念之字节码 介绍 版本:Java SE 7 每位使用 Java 的程序员都知道 Java 字节码在 Java 运行时(JRE - Java Runtime Enviro ...
- JVM 内部原理(一)— 概述
JVM 内部原理(一)- 概述 介绍 版本:Java SE 7 图中显示组件将会从两个方面分别解释.第一部分涵盖线程独有的组件,第二部分涵盖独立于线程的组件(即线程共享组件). 目录 线程独享(Thr ...
- Understanding JVM Internals---不得不转载呀
http://www.cubrid.org/blog/dev-platform/understanding-jvm-internals/ http://architects.dzone.com/art ...
- JVM Guide
Java Virtual Machine: the Essential Guide October 8th, 2014 - By Alexey Zhebel Introduction Java Vir ...
随机推荐
- 如何从代码层防御10大安全威胁中的 Xpath Injection?
普遍性和可检测性: Xpath 注入是 OWASP TOP10 安全威胁中 A1 Injection 中的一种,注入漏洞发生在应用程序将不可信的数据发送到解释器时.虽然注入漏洞很容易通过审查代码发现, ...
- Spark:Master High Availability(HA)高可用配置的2种实现
Spark Standalone集群是Master-Slaves架构的集群模式,和大部分的Master-Slaves结构集群一样,存在着Master单点故障的问题.如何解决这个单点故障的问题,Spar ...
- XAMPP下的composer的安装
很多开源软件,都需要通过composer来安装,Composer 是 PHP 的一个依赖管理工具.它允许你申明项目所依赖的代码库,它会在你的项目中为你安装他们. 声明关系 比方说,你正在创建一个项目, ...
- HTTP 错误 500.21 - Internal Server Error处理程序“PageHandlerFactory-Integrated”在其模块列表中有一个错误模块“ManagedPipelineHandler”
HTTP 错误 500.21 - Internal Server Error处理程序“PageHandlerFactory-Integrated”在其模块列表中有一个错误模块“ManagedPipel ...
- web.xml中的contextConfigLocation的作用
在web.xml中通过contextConfigLocation配置spring,contextConfigLocation 参数定义了要装入的 Spring 配置文件. 如果想装入多个配置文件,可以 ...
- HDOJ/HDU 2562 奇偶位互换(交换位置~)
Problem Description 给定一个长度为偶数位的0,1字符串,请编程实现串的奇偶位互换. Input 输入包含多组测试数据: 输入的第一行是一个整数C,表示有C测试数据: 接下来是C组测 ...
- HDOJ 1716 排列2 next_permutation函数
Problem Description Ray又对数字的列产生了兴趣: 现有四张卡片,用这四张卡片能排列出很多不同的4位数,要求按从小到大的顺序输出这些4位数. Input 每组数据占一行,代表四张卡 ...
- JavaScript DOM-Ready 机制
IE9开始和其他现代浏览器可以通过绑定DOMContentLoaded事件:IE9之前的的浏览器需要绑定onreadystatechange事件并等待readyState为"complete ...
- POJ3186:Treats for the Cows(区间DP)
Description FJ has purchased N (1 <= N <= 2000) yummy treats for the cows who get money for gi ...
- angularjs post 跨域
web api搞好了:用Ajax妥妥的:但是前端用的AngulagJS,也懒得再换为Ajax了: 但是问题来了:提示: 已拦截跨源请求:同源策略禁止读取位于 http://x.x.x.x:port/a ...