当前位置:网站首页>zgc的Allocate stall原理
zgc的Allocate stall原理
2022-06-09 06:23:00 【lixia0417mul2】
- zgc的内存管理分成两级管理模式:首先是分配内存页面,其次才是从内存页面中分配对象,
- Allocate stall发生在分配内存页面的阶段,与jvm的ZStallOnOutOfMemory(默认为true)参数密切相关,当ZStallOnOutMemory参数为false,此时分配内存页面,当时当前没有空闲的内存页面时,jvm就会直接抛出OutOfMemory异常。
- 当ZStallOnOutOfMemory为true时,此时如果内存页面分配失败,则产生一个阻塞的页面分配请求插入到请求队列的末尾,然后启动zgc垃圾回收,当zgc垃圾回收回收到空闲的页面空间时,就会把该页面分配给队列中阻塞等待的页面分配请求.
正常内存充足情况下应用线程的最大阻塞时间是初始标识,重新标识,初始转移中的最大值,然而当发生Allocate stall时,由于需要回收到空闲页面应用线程才能继续运行下去,所以应用线程需要等待一直到有空闲的内存页面为止,而这个时间一般需要经过:初始标识+并发标识+重新标识+清理 或者 初始标识+并发标识+重新标识+清理(假设这里没有页面完全都是垃圾对象) + 初始转移+并发转移 这些步骤之后,应用线程才能获取到空闲的页面继续运行。
以上所述,尽量不要让zgc进入到Allocate Stall中,如果发现了这个日志,需要调整zgc的参数,提早进行zgc的回收.
边栏推荐
猜你喜欢
随机推荐
"= =" what is the difference between the equals method and the equals method?
Postman 安装
The performance comparison of Quanzhi T3 (a40i) /t5 (t507) is better than that of the previous generation
Coredns part 4-compiling and installing unbound
[early spring 2022] [leetcode] 45 Jumping game II
Openresty newly added module
adam 神经网络
Transplant qt5.12 to t507 development board
Unity3d various paths & permissions
深度学习之二手手机价格预测
自然语言之文本预处理
[reprint] LCD common interface principle
小米4安装微信失败
Ping: xxx: unknown name or service reason analysis
Quanzhi H3 was discontinued, and a40i/t3 was even better -- com-x40i core module came
The national industrial level Quanzhi t3/a40i core board -com-x40i helps the intelligent power system
TypeScript
MT2712 USB
LDAP application: openldap integrated into jumpserver
全志平台BSP裁剪(7)rootfs裁剪--用户工具和库的裁剪 & rootfs压缩








