当前位置:网站首页>JVM运行时数据区(一)
JVM运行时数据区(一)
2022-04-23 02:29:00 【飞翔荷兰号】
一、基本
- 红色部分:会随着虚拟机的启动而创建,随着虚拟机的退出而销毁
- 灰色部分:与线程一一对应,随着线程的启动和结束,随之产生而结束
- 一个Runtime, 对应一个JVM虚拟机
二、概念
1. 线程
1. 线程是一个程序里的运行单元, JVM允许一个一个应用有多个线程并行执行
2. 每个线程都与操作系统的本地线程直接映射
2.1 当一个java线程准备好后,此时一个操作系统的本地线程也会创建
2.2 java线程执行终止后,本地线程也会回收
3. 操作系统负责将线程的安排调度到任何一个可用的cpu上
一旦本地线程初始化成功,就会调用java线程中的run()
2. 程序计数器
2.1 概念
- PC寄存器, PC Register, Program Counter Register, 指令计数器
- 线程的代码指令:通过程序计数器来进行保存和再次获取,就是用来线程切换
- 一个线程中会包含一个程序计数器,记录代码指令执行行数,属于线程私有
- 存储空间比较小,几乎可以忽略不计,也是运行速度最快的
- 不存在OOM
任何时候一个线程只有一个方法可以执行(当前方法)
存储当前线程正在执行的java方法的jvm指令地址,如果执行native方法,则是undefined
版权声明
本文为[飞翔荷兰号]所创,转载请带上原文链接,感谢
https://blog.csdn.net/weixin_43374578/article/details/124356923
边栏推荐
猜你喜欢
【Chrome扩展程序】content_script的跨域问题
This is how the power circuit is designed
010_StringRedisTemplate
Wechat public platform test number application, authorized login function and single sign on using hbuilder X and wechat developer tools
Parental delegation model [understanding]
VMware virtual machine installation openwrt as side route single arm route img image to vmdk
Handwritten memory pool and principle code analysis [C language]
012_ Access denied for user ‘root‘@‘localhost‘ (using password: YES)
The 16th day of sprint to the big factory, noip popularization Group Three Kingdoms game
Chinese scientists reveal a new mechanism for breaking through the bottleneck of rice yield
随机推荐
A domestic image segmentation project is heavy and open source!
012_ Access denied for user ‘root‘@‘localhost‘ (using password: YES)
Applet canvas canvas half ring
每日一题冲刺大厂第十六天 NOIP普及组 三国游戏
2018 China Collegiate Programming Contest - Guilin Site J. stone game
十六、异常检测
[chrome extender] content_ Cross domain problem of script
Consider defining a bean of type ‘com.netflix.discovery.AbstractDiscoveryClientOptionalArgs‘
下载正版Origin Pro 2022 教程 及 如何 激 活
Flink real-time data warehouse project - Design and implementation of DWS layer
在MySQL Workbench中执行外部的SQL脚本,报错
Leetcode40 - total number of combinations II
电源电路设计原来是这么回事
Lane cross domain problem
arduino esp8266 网络升级 OTA
Niuke hand speed monthly race 48 C (I can't understand the difference. It belongs to yes)
001_redis设置存活时间
IAR嵌入式開發STM32f103c8t6之點亮LED燈
89 logistic regression user portrait user response prediction
day18--栈队列