当前位置:网站首页>The JVM: (3) the runtime data area
The JVM: (3) the runtime data area
2022-08-06 16:24:00 【third brother】
Article table of contents
3.1 Overview
This section mainly talks about the runtime data area, which is the part in the figure below, which is the stage after the class loading is completed

When we pass the previous stages: class loading -> verification -> preparation -> parsing -> initialization, the execution engine will be used to use our class, and the execution engine will useto our runtime data area

Memory is a very important system resource. It is the intermediate warehouse and bridge between the hard disk and the CPU. It carries the real-time running JVM memory layout of the operating system and applications.It ensures the efficient and stable operation of the JVM.Different JVMs have some differences in the way of memory division and management mechanism.Combined with the JVM virtual machine specification, let's discuss the classic JVM memory layout.

We compare the things behind the chef (cooked vegetables, knives, seasonings) to the runtime data area.And the chef can be analogous to the execution engine, making the prepared things into exquisite dishes

The data we get through the disk or network IO needs to be loaded into the memory first, and then the CPU gets the data from the memory for reading, which means that the memory acts as a bridge between the CPU and the disk
The Java virtual machine defines several runtime data areas that will be used during program execution, some of which will be created when the virtual machine starts and destroyed when the virtual machine exits.Others are one-to-one correspondence with threads, and these data areas corresponding to threads are created and destroyed as threads start and end.
Grey is private to a single thread, red is shared by multiple threads.That is:
Each thread: independently includes program counter, stack, local stack.
Inter-thread sharing: heap, off-heap memory (permanent generation or metaspace, code cache)
Each JVM has only one instance of Runtime, which is the runtime environment.
3.2 thread
A thread is a unit of execution in a program.The JVM allows an application to have multiple threads executing in parallel.In the Hotspot JVM, each thread maps directly to the operating system's native thread.
When a Java thread is ready to execute, an OS-native thread is also created at the same time.The native thread is also recycled after the Java thread execution terminates.
The operating system is responsible for scheduling all threads to any available CPU.Once the native thread is successfully initialized, it calls the run() method in the Java thread.
3.3 JVM system thread
If you use the console or any debugging tool, you can see that there are many threads running in the background.These background threads do not include the main thread that calls public static void main(String[] args) and all threads created by this main thread itself.
These main background system threads in the Hotspot JVM are mainly the following:
Virtual machine thread: The operation of this thread requires the JVM to reach a safe point before it occurs.The reason these operations have to happen in different threads is that they all require the JVM to reach a safe point so the heap doesn't change.Such thread execution types include "stop-the-world" garbage collection, thread stack collection, thread suspension, and biased lock revocation.
Periodic task threads: These threads are the embodiment of time-period events (such as interrupts), and they are generally used for scheduled execution of periodic operations.
GC thread: This thread provides support for different kinds of garbage collection behavior in the JVM.
Compiler thread: This thread compiles bytecode into native code at runtime.
Signal Scheduling Thread: This thread receives signals and sends them to the JVM, which handles them internally by calling the appropriate method.
边栏推荐
- virtio_net 设备的队列数问题
- LeetCode:724. 寻找数组的中心下标————简单
- Activiti部署文件时,报错org.activiti.bpmn.exceptions.XMLException: cvc-complex-type.2.4.a: 发现了以元素 ‘process‘
- 基于TCP/IP协议,定义原始的字节流协议传输Student类
- 口碑极佳的7个公众号!
- 小程序图片转base64方案(多种解决方案)
- 织梦文档为待审核稿件引起tag标签文档消失bug修复
- Google的工程实践指南(下):代码开发者指南
- Detailed explanation of IK tokenizer
- 云原生正在吞噬一切,开发者该如何应对?
猜你喜欢

scanpy category类型注意

Unstoppable, a major breakthrough in China's chip manufacturing industry chain, 5nm equipment will soon be sent to TSMC

ASEMI整流桥GBL610参数,GBL610尺寸,GBL610特征
![有重复字符的排列组合[回溯 & 剪枝去重 || set去重]](/img/b7/636aeb3af5603e1d945b175af56500.png)
有重复字符的排列组合[回溯 & 剪枝去重 || set去重]

LeetCode:206. 反转链表————简单

LeetCode: 205. Isomorphic Strings - Simple

dedecms证明手机站下一篇变上一篇而且还出错Request Error!

Likou 07 - Linked List Intersection - Linked List & Hash Table Storage & Double Pointer

小程序中实现搜索功能

《A Biography of the Pixel》摘阅
随机推荐
华泰证券靠谱吗?开户安全吗?
n个数的全排列
同花顺登录证券账号安全么
LeetCode:21. 合并两个有序链表————简单
SAP CRM Fiori 应用 My Opportunity 的分页读取逻辑,在 GM4 - AG3 无法正常工作
分享几个常用的国外英文论文文献数据库,先收藏再说
Helm deployment ES and Kibana (default open SSL)
SOFA Weekly|Meetup 广州站参会指南、本周 QA、本周 Contributor
基于TCP/IP协议,定义原始的字节流协议传输Student类
05、GO数组与切片
Douyin slider verification scheme s_v_web_id parameter analysis
LeetCode:205. 同构字符串————简单
cmd command line tool
网络基础
##mysql数据库的安装部署
LeetCode SQL专项练习(3) 字符串处理函数/正则
四、MYSQL数据类型
Unstoppable, a major breakthrough in China's chip manufacturing industry chain, 5nm equipment will soon be sent to TSMC
深入理解AVLTree【旋转控制平衡(单旋、双旋)】
Rsync 数据同步工具