当前位置:网站首页>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
边栏推荐
- Applet canvas canvas half ring
- 从开源爱好者到 Apache 董事,一共分几步?
- Class initialization and instance initialization interview questions
- RT_Thread自问自答
- 007_Redis_Jedis连接池
- PTA: 点赞狂魔
- They are all intelligent in the whole house. What's the difference between aqara and homekit?
- A simple and open source navigation website source code
- Tp6 Alibaba cloud SMS window reports curl error 60: SSL certificate problem: unable to get local issuer certificate
- Handwritten memory pool and principle code analysis [C language]
猜你喜欢

Want to experience homekit smart home? Why don't you take a look at this smart ecosystem

So library dependency

013_基于Session实现短信验证码登录流程分析

一、序列模型-sequence model

Applet canvas canvas half ring

VMware virtual machine installation openwrt as side route single arm route img image to vmdk

Kubernetes cluster installation based on Kirin SP10 server version

认识进程(多线程_初阶)

006_ redis_ Jedis quick start

【汇编语言】从最底层的角度理解“堆栈”
随机推荐
程序设计天梯赛 L1-49 天梯赛分配座位(模拟),布响丸辣
Flink real-time data warehouse project - Design and implementation of DWS layer
【ValueError: math domain error】
A domestic image segmentation project is heavy and open source!
Handwritten memory pool and principle code analysis [C language]
手写内存池以及原理代码分析【C语言】
LeetCode 447. Number of boomerangs (permutation and combination problem)
Class initialization and instance initialization interview questions
OJ daily practice - Finish
Campus transfer second-hand market source code
Parental delegation model [understanding]
[assembly language] understand "stack" from the lowest point of view
Dynamic memory management
ThinkPHP kernel development blind box mall source code v2 0 docking easy payment / Alibaba cloud SMS / qiniu cloud storage
tp6阿裏雲短信 window 報 cURL error 60: SSL certificate problem: unable to get local issuer certificate
Chinese scientists reveal a new mechanism for breaking through the bottleneck of rice yield
Develop a chrome plug-in from 0 (2)
VMware virtual machine installation openwrt as side route single arm route img image to vmdk
都是做全屋智能的,Aqara和HomeKit到底有什么不同?
A simple and open source navigation website source code