当前位置:网站首页>Fast crosstalk -- partition of JVM memory
Fast crosstalk -- partition of JVM memory
2022-04-22 13:34:00 【Wanmao Society】
Purpose
- Rapid positioning JVM Memory leak or overflow, etc .
- Basic questions of interview , pluses .
Program counter (Program Counter Register)
- Record the line number of bytecode executed by the current thread .
- Rely on it to implement branches 、 loop 、 Jump 、 exception handling 、 Thread recovery .
- Natvie When the method is used , Its value is empty .
- Java The only area in the virtual machine specification that does not specify memory overflow .
- “ Thread private ” The memory area of .
Virtual machine stack (Virtual Machine Stacks)
- Its life cycle is the same as thread .
- Store local variable table 、 The stack of operands 、 Dynamic links 、 Method exit information .
- When the method is executed, a stack frame is created and merged into the stack .
- When the execution of the method is completed, the corresponding stack frame is out of the stack .
- When the stack depth is too deep , Throw out StackOverflowError .
- Too many threads , Throw out OutOfMemoryError .
- “ Thread private ” The memory area of .
Native Method Stack (Native Method Stacks)
- Used for virtual machines Native Method service .
- When the stack depth is too deep , Throw out StackOverflowError .
- Too many threads , Throw out OutOfMemoryError .
- “ Thread private ” The memory area of .
Pile up (Java Heap)
- For storing object instances , yes JVM The largest area of memory .
- The main area of garbage collector Management .
- When using the generational collection algorithm , Heaps are subdivided into Cenozoic and older generations , The new generation is subdivided into Eden Space 、 From Survivor Space 、 To Survivor Space .
- stay HotSpot In the virtual machine , adopt -Xmx and -Xms Control the size of the heap , adopt -Xmn Control the size of the Cenozoic .
- The heap can be in a physically discontinuous memory space , As long as it's logically continuous .
- When there is no memory to complete the instance allocation , Throw out OutOfMemoryError .
- “ Thread sharing ” The memory area of , The heap shared by threads may be divided into private allocation buffers of multiple threads (Thread Local Allocation Buffer,TLAB).
Method area (Method Area)
- Storage has been JVM Class information loaded 、 Constant 、 Static variables 、 Real time compiler compiled code .
- The goal of recycling is mainly to recycle the constant pool and unload the type .
- You can choose not to implement garbage collection .
- When the method area cannot meet the memory allocation requirements , Will throw out OutOfMemoryError .
- JDK6 Use the permanent generation to implement the method area .
- JDK7 Yongkudai's string constant pool has been removed .
- JDK8 Use the meta space to implement the method area .
- “ Thread sharing ” The memory area of .
summary
- Program counter : The line number indicator of bytecode executed by the current thread .
- Virtual machine stack :Java Memory model for method execution , Used to store local variables 、 The stack of operands 、 Dynamic links 、 Method exit information .
- Native Method Stack : Memory model for local method execution , Very similar to the virtual machine stack , The difference is that the local method stack is JVM Used Native Method service .
- Pile up : Used to store object instances , Is the main area of garbage collector Management .
- Method area : Used to store has been JVM Class information loaded 、 Constant 、 Static variables 、 Real time compiler compiled code and other data .
版权声明
本文为[Wanmao Society]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204221324098142.html
边栏推荐
- Share the five cases of websites slowing down recently
- PHP 零基础入门笔记(12):数组 array
- Inamori Kazuo: face the reality, think hard and fight head-on
- MapReduce case - join operation is realized through the reduce side and the map side respectively
- BAIC Foton, Sinopec and light engineering Internet of things set up Sinopec to sell hydrogen energy (Beijing)
- 阿里云换帅,争抢华为的地盘
- 封装统一响应结果枚举类(工具模块)
- Rust实现斐波那契数
- MySQL DNS resolution and host cache
- 路由基础之OSPF基本配置
猜你喜欢

Citrix SQL数据如何进行多表联查

FreeRTOS quick start

It's rare to make a profit or a flash in the pan. Daphne can't learn from the Antarctic

Rust implements Fibonacci number

Walking in the clouds - above firewood, rice, oil and salt

分块——优雅的暴力

好物合集(1)

Xen thermal repair technology (basic understanding)

redis持久化

Chinese English Dictionary of Accounting & Financial sentiment
随机推荐
mysql FUNCTION xxx. CHARINDEX does not exist
How does redis view the memory size occupied by a single key
RedisConfig配置类
MapReduce案例—分别通过Reduce端和Map端实现JOIN操作
Walk in the clouds - travel to the edge of the universe
Harbor v2.5更新,都增加了哪些功能?
Summary of maximum matching number, minimum path coverage number, maximum independent number and minimum point coverage number theorems
Functional limit of calculus
Share the five cases of websites slowing down recently
启牛学堂让下载蜻蜓点金开户,才能继续在学习?可以下载嘛?安全吗?
[live broadcast attack] the oneos system tutorial is fully launched. We invite you to study with ST and oneos!
no main manifest attribute / .jar中没有主清单属性
路由基础之OSPF基本配置
上市公司营业收入数据集(1990-2021第三季度)
Communication principle of SPI protocol
BPMN - how to draw a basic BPMN that conforms to well structured choreography?
说了栈和队列的区别以后,面试官当场就吐了,同学们千万要引以为戒。
Mysql database has been started successfully, but show is not an internal or external command. How to solve it?
Citrix SQL数据如何进行多表联查
Données du panel sur la productivité verte totale des facteurs du pfgt par province (2004 - 2018)