首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >快照的GC会影响性能吗?用户可以强制GC吗?

快照的GC会影响性能吗?用户可以强制GC吗?
EN

Stack Overflow用户
提问于 2018-10-14 14:50:51
回答 1查看 313关注 0票数 0

我观察到,在快照期间,系统运行GC。

以下是在快照过程中发生的一些示例GC日志。

节点1:

代码语言:javascript
复制
[2018-10-14T06:01:56,133][INFO ][o.e.m.j.JvmGcMonitorService] [n1] [gc][1121610] overhead, spent [257ms] collecting in the last [1s]
[2018-10-14T06:02:09,020][WARN ][o.e.m.j.JvmGcMonitorService] [n1] [gc][old][1121612][216] duration [11.3s], collections [1]/[11.8s], total [11.3s]/[4.4m], memory [18.5gb]->[8.3gb]/[29.8gb], all_pools {[young] [795.3mb]->[221.8mb]/
[1.4gb]}{[survivor] [118.7mb]->[0b]/[191.3mb]}{[old] [17.6gb]->[8gb]/[28.1gb]}
[2018-10-14T06:02:09,020][WARN ][o.e.m.j.JvmGcMonitorService] [n1] [gc][1121612] overhead, spent [11.5s] collecting in the last [11.8s]

[2018-10-14T06:06:22,978][INFO ][o.e.m.j.JvmGcMonitorService] [n1] [gc][1121865] overhead, spent [312ms] collecting in the last [1s]
[2018-10-14T06:06:23,978][INFO ][o.e.m.j.JvmGcMonitorService] [n1] [gc][1121866] overhead, spent [463ms] collecting in the last [1.2s]
[2018-10-14T06:06:25,090][INFO ][o.e.m.j.JvmGcMonitorService] [n1] [gc][1121867] overhead, spent [313ms] collecting in the last [1.1s]
[2018-10-14T06:06:26,102][INFO ][o.e.m.j.JvmGcMonitorService] [n1] [gc][1121868] overhead, spent [343ms] collecting in the last [1s]

[2018-10-14T06:06:51,282][INFO ][o.e.m.j.JvmGcMonitorService] [n1] [gc][1121893] overhead, spent [367ms] collecting in the last [1s]
[2018-10-14T06:06:53,283][INFO ][o.e.m.j.JvmGcMonitorService] [n1] [gc][1121895] overhead, spent [256ms] collecting in the last [1s]
[2018-10-14T06:07:06,347][INFO ][o.e.m.j.JvmGcMonitorService] [n1] [gc][1121908] overhead, spent [255ms] collecting in the last [1s]
[2018-10-14T06:07:07,410][INFO ][o.e.m.j.JvmGcMonitorService] [n1] [gc][1121909] overhead, spent [282ms] collecting in the last [1s]
[2018-10-14T06:07:10,583][INFO ][o.e.m.j.JvmGcMonitorService] [n1] [gc][1121912] overhead, spent [348ms] collecting in the last [1.1s]

节点2:

代码语言:javascript
复制
[2018-10-14T06:06:16,697][INFO ][o.e.m.j.JvmGcMonitorService] [n2] [gc][old][19089995][4491] duration [7s], collections [1]/[8.4s], total [7s]/[1h], memory [18.5gb]->[9.9gb]/[29.8gb], all_pools {[young] [738.3mb]->[66mb]/[1.4gb]}{[
survivor] [149.9mb]->[0b]/[191.3mb]}{[old] [17.6gb]->[9.8gb]/[28.1gb]}
[2018-10-14T06:06:16,699][WARN ][o.e.m.j.JvmGcMonitorService] [n2] [gc][19089995] overhead, spent [7.4s] collecting in the last [8.4s]
[2018-10-14T06:06:25,703][INFO ][o.e.m.j.JvmGcMonitorService] [n2] [gc][19090004] overhead, spent [281ms] collecting in the last [1s]
[2018-10-14T06:06:26,706][INFO ][o.e.m.j.JvmGcMonitorService] [n2] [gc][19090005] overhead, spent [254ms] collecting in the last [1s]

2018-10-14T06:07:07,981][INFO ][o.e.m.j.JvmGcMonitorService] [n2] [gc][19090046] overhead, spent [277ms] collecting in the last [1s]
[2018-10-14T06:07:09,981][INFO ][o.e.m.j.JvmGcMonitorService] [n2] [gc][19090048] overhead, spent [299ms] collecting in the last [1s]
[2018-10-14T06:07:22,186][INFO ][o.e.m.j.JvmGcMonitorService] [n2] [gc][19090060] overhead, spent [294ms] collecting in the last [1s]

我们可以看到旧的GC发生了。我所发现的是,如果一个节点在快照之前做了旧GC,它在快照时间之后存活了旧GC并获得了许多非旧GC……

这会影响系统性能吗?在创建快照的过程中,有没有办法将系统调优为非GC?例如,我们可以强制一个节点在快照之前运行旧GC吗?

EN

回答 1

Stack Overflow用户

发布于 2018-10-14 15:24:56

完整的GC是停止世界进程,并显著影响性能。运行几秒钟的小GC应该不会影响系统性能。GC是一个内部进程,除非应用程序配置了较低的堆内存,并且遇到OutOfMemory错误或长时间GC暂停,否则不会引起担忧。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/52800216

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档