当前位置:网站首页>JVM Part 1: memory and garbage collection part 3 - runtime data area - overview and threads
JVM Part 1: memory and garbage collection part 3 - runtime data area - overview and threads
2022-07-27 05:14:00 【_ Dean_】
JVM Part 1 : Memory and garbage collection Chapter 3 – Run time data area - Overview and thread
1. Preface & summary
This section focuses on the runtime data area , That's the part below , It's in the stage after class loading is complete

When we pass the front : Class loading -> verification -> Get ready -> analysis -> initialization After these stages are completed , We will use the execution engine to use our classes , At the same time, the execution engine will use our runtime data area

That is, the chef cooks , We put the stuff behind the chef ( Cut vegetables , The knife , seasoning ), Compare it to the runtime data area . And cooks can be compared to executive engines , Will be prepared through the things made into exquisite dishes

Memory Is a very important system resource ,** It's hard disk and CPU Middle warehouse and Bridge , It carries the real-time operation of the operating system and application program JVM The memory layout defines Java Memory request during run 、 Distribute 、 Managed policies , To ensure the JVM Efficient and stable operation of .** Different JVM There are some differences between memory partition and management mechanism . combination JVM Virtual machine specification , Let's talk about the classic JVM Memory layout .
We use disks or networks IO Data obtained , All need to be loaded into memory first , then CPU Get data from memory for reading , In other words, memory acts as CPU The bridge between disk and disk
A complete diagram of the runtime data area

Java Virtual machine defines several kinds of runtime data areas that will be used during program running , Some of them will be created as the virtual machine starts , Destroy as virtual machine exits . Others correspond to threads one by one , These data regions corresponding to the thread are created and destroyed as the thread starts and ends .
The gray ones are private to individual threads , The red ones are shared by multiple threads . namely :
Every thread: Independence includes Program counter 、 Stack 、 Local stack .Sharing between threads: Pile up 、 Out of heap memory ( Permanent generation or meta space 、 Code cache )

Description of sharing between threads
2.JVM Thread description
A thread is a running unit in a program .JVM Allows an application to have multiple threads executing in parallel .
stay Hotspot JVM in , Each thread is mapped directly to the local thread of the operating system .
- When one Java When the thread is ready to execute , At this time, a local thread of the operating system is also created .Java After thread execution is terminated , Local threads also recycle .
The operating system is responsible for scheduling all threads to any available CPU On . Once the local thread is initialized successfully , It's going to call Java In thread run() Method .
2.1JVM System threads
If you use jconsole Or any debugging tool , You can see that there are many threads running in the background . These background threads do not include calls public static void main(String[]) Of main Threads and all this main A thread created by a thread itself .|
These main background system threads are in Hotspot JVM There are mainly the following :
Virtual machine threads: The operation of this thread is need JVM The safety point will be reached . The reason these operations have to happen in different threads is that they all need JVM Reach safety point , So the pile doesn't change . The execution types of this thread include "stop-the-world" Garbage collection , Thread stack collection , Thread suspension and biased lock revocation .Periodic task thread: This thread is The embodiment of time periodic events ( Like interruptions ), They are generally used for scheduling execution of periodic operations .GC Threads: This thread Yes JVM There are different kinds of garbage collection behaviors that support .Compile thread: This thread will Compile bytecode into local code .Signal scheduling thread: This thread receives Signal and send it to JVM, Inside it, it's handled by calling the appropriate method .
边栏推荐
- [Niuke discussion area] Chapter 7: building safe and efficient enterprise services
- 节流函数的demo——正则表达式匹配
- 一、MySQL基础
- There is no need to install CUDA and cudnn manually. You can install tensorflow GPU through a one-line program. Take tensorflow gpu2.0.0, cuda10.0, cudnn7.6.5 as examples
- Laozi cloud and Fuxin Kunpeng achieved a major breakthrough in 3D ofd 3D format documents for the first time
- Summary of knowledge points (I)
- 使用mq消息队列来进行下单流程的高并发设计,消息挤压,消息丢失,消息重复的产生场景和解决方案
- Card drawing program simulation
- Could not autowire.No beans of ‘userMapper‘ type found.
- 文件对话框
猜你喜欢

JVM上篇:内存与垃圾回收篇六--运行时数据区-本地方法&本地方法栈

How to import PS style? Photoshop style import tutorial

How to test the payment process?

树莓派rtmp推流本地摄像头图像

Detailed explanation of mvcc and its principle

TypeScript 详解

Hiding skills of Photoshop clipping tool

When using Photoshop, the prompt "script error -50 general Photoshop error appears“

ssm框架整合

What if Photoshop prompts that the temporary storage disk is full? How to solve the problem that PS temporary storage disk is full?
随机推荐
Demo of throttling function -- regular expression matching
Interface and abstract class / method learning demo
集合框架的使用
DBUtils
安装Pygame
Could not autowire. No beans of ‘userMapper‘ type found.
File dialog box
Could not autowire.No beans of ‘userMapper‘ type found.
Quoted popular explanation
How to sinicize the JMeter interface?
树莓派输出PWM波驱动舵机
How idea creates a groovy project (explain in detail with pictures and texts)
Complete Binary Tree
When using Photoshop, the prompt "script error -50 general Photoshop error appears“
JVM上篇:内存与垃圾回收篇七--运行时数据区-堆
"Photoshop2021 tutorial" align and distribute to make dot patterns
Transaction database and its four characteristics, principle, isolation level, dirty read, unreal read, non repeatable read?
How does PS import LUT presets? Photoshop import LUT color preset tutorial
Three paradigms, constraints, some keyword differences,
事件总结-常用总结
