当前位置:网站首页>JVM heap
JVM heap
2022-06-11 21:05:00 【Just number six Z】
JVM Stack area of
2.4 Pile up
One JVM There is only one heap in the instance , So is heap Java The core area of memory management .
The only purpose of the heap is to store object instances , Almost all object instances and data are allocated memory here .
Java The heap is the main area managed by the garbage collector , So it's also called GC Pile up .
(1) Memory partition of heap
- The new generation
- Eden
- Survivor
- from
- to
- Old age
- Meta space ( Forever )
(2) Set heap memory size
- -Xmx Used to represent the starting memory of the heap , By default , The initial heap memory size is : Computer memory size / 64
- -Xms Used to represent the maximum memory of the heap , By default , The maximum heap memory size is : Computer memory size / 4
(3) Common in the stack area OOM
java.lang.OutOfMemoryError: GC Overhead Limit Exceeded: When JVM When it takes too much time to perform garbage collection and only a small amount of heap space can be recycled , This error will happen .java.lang.OutOfMemoryError: Java heap space: If you are creating a new object , There is not enough space in the heap memory to hold the newly created objects , It will cause this error .Permgen space: Permanent generation is full , Usually loaded class Too many or too big 、
Object allocation process
- new The object of is stored in eden District , But Eden Park has a size limit
- When eden When the space is full , The program needs to create objects ,JVM Our garbage collector will recycle the garbage of Eden Park (Minor GC), Destroy the objects in Eden Park that are no longer referenced by other objects , Then load the new object and put it in the garden of Eden
- Then move the remaining objects in Eden to the survivors 0 District
- If garbage collection is triggered again , At this point, the last survivor is placed in the survivor 0 District , without i Recycling , It's going to put the survivors 1 District
- The default is 15 The recycling mark will enter the old generation
- When the older generation runs out of memory , Trigger again Major GC, Clean up the old memory
- If the old age carried out Major GC After that, it is found that the object cannot be saved , It will produce OOM abnormal
Memory allocation policy
- Give priority to Eden Park
- Large objects are directly allocated to the old age
- Long lived objects are assigned to old age
- If survivor The sum of the sizes of all objects of the same age in the region is greater than survivor Half of the space , Objects older than or equal to this age can directly enter the elderly generation
- Space allocation guarantee
边栏推荐
- Which Bluetooth headset is better within 500? Inventory of gifts for girls' Day
- Chinese text classification based on CNN
- Object storage of CEPH distributed storage
- PHP strtotime 获取自然月误差问题解决方案
- 可综合RTL代码设计方法和注意事项
- How to Load Data from CSV (Data Preparation Part)
- Obsidian关系图谱如何让节点可以手动拖动
- 【博弈论-完全信息静态博弈】 战略式博弈
- [computer exemption] the Internet of things and ubiquitous intelligence research center of Harbin Institute of technology recruits 2023 graduate students (Master, doctoral and direct doctoral) from un
- JVM之堆区
猜你喜欢

Redis fourth session - redis high performance principle (multiplexing) and high availability analysis (backup, master-slave)

Wechat applet | rotation chart

ORA-04098: trigger ‘xxx.xxx‘ is invalid and failed re-validation
![[nk] deleted number of 100 C Xiaohong in Niuke practice match](/img/f1/a99600e1800c087aceb60a559dee39.png)
[nk] deleted number of 100 C Xiaohong in Niuke practice match

BCC tool tool usage

全球机器视觉市场规模持续上涨,PoE图像采集卡为工业相机提供高速传输通道
![[data visualization] Apache superset 1.2.0 tutorial (II) - Quick Start (visualizing King hero data)](/img/21/c2212a674fdf77571305446217a5ca.png)
[data visualization] Apache superset 1.2.0 tutorial (II) - Quick Start (visualizing King hero data)

【数据可视化】Apache Superset 1.2.0教程 (三)—— 图表功能详解

从概率论基础出发推导卡尔曼滤波

第二部分 数据链路层
随机推荐
Implement AOP and interface caching on WPF client
Solution to the problem of PHP strtotime obtaining natural monthly error
Yintai department store and Taobao tmall jointly create a green fashion show to help "carbon neutrality"
LR-LINK联瑞携新品首次亮相数博会-助力新基建数据中心建设
RANSAC提取平面(MATLAB内置函数)
为什么需要微服务
Capriccio in the Internet Age
Pyqt5 technical part - cause of the problem that setting the top of the window does not take effect. Setwindowflags() does not take effect after setting the parameters. Solution
IDEA中,运行yarn命令,显示无法加载文件,因为在此系统上禁用运行脚本
Object storage of CEPH distributed storage
重投农业,加码技术服务,拼多多底盘进一步夯实
正则校验匹配[0-100]、[0-1000]之间的正整数或小数点位数限制
Gestionnaire de paquets d'Unit é Starting Server Stuck
Field queryIndexFieldnameService in xxxImpl required a single bean, but 19 were found:
Teach you how to grab ZigBee packets through cc2531 and parse encrypted ZigBee packets
stream中文排序
Space transcriptome experiment | what factors will affect the quality of space transcriptome sequencing during the preparation of clinical tissue samples?
Release of version 5.6 of rainbow, add multiple installation methods, and optimize the topology operation experience
JMeter load test finds the maximum number of concurrent users (including step analysis)
Interviewer: what is the event flow and event model in JS?