首页 > 解决方案 > 带有描述的 Hotspot VM 操作列表

问题描述

Java Hotspot VM 可以执行许多不同的 VM 操作。在调试安全点时间时,了解安全点的用途是很有用的。其中一些是显而易见的:G1IncCollectionPauseFindDeadlocks,但有些不是:CGC_Operation, no vm operation。有 VMOps.java,但它只列出可能的值,而不是它们的含义。

目前,我需要知道CGC_Operation在 G1GC 的上下文中做了什么。我怀疑它与 ConcurrentGCThread 和 Old gen 集合有关,但我想确认并有一些参考以寻找其他操作。

例子:

-XX:+PrintSafepointStatistics
...
128959.961: G1IncCollectionPause [ 2636 0 1 ] [ 0 0 0 15 52 ] 0
129986.695: G1IncCollectionPause [ 2637 0 0 ] [ 0 0 0 12 51 ] 0
137019.250: G1IncCollectionPause [ 2636 0 0 ] [ 0 0 0 13 50 ] 0
138693.219: CGC_Operation [ 2636 0 0 ] [ 0 0 0 13 338 ] 0
138726.672: G1IncCollectionPause [ 2636 0 0 ] [ 0 0 0 13 50 ] 0
138733.984: G1IncCollectionPause [ 2636 0 1 ] [ 0 0 0 13 50 ] 0
138738.750: G1IncCollectionPause [ 2636 0 0 ] [ 0 0 0 13 62 ] 0

标签: javajvm-hotspotg1gc

解决方案


最好的(可能是唯一的)文档是源代码。幸运的是,HotSpot JVM 源代码得到了很好的评论。

请参阅src/share/vm/gc_implementation/g1/vm_operations_g1.hpp

// Concurrent GC stop-the-world operations such as remark and cleanup;
// consider sharing these with CMS's counterparts.
class VM_CGC_Operation: public VM_Operation {

no vm operation表示各种清理活动的特殊类型的定期安全点,请参阅此答案


推荐阅读