JDK-8156870 : Release Note: Providing more granular levels for GC verification
  • Type: Sub-task
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 7u111,8u102,9
  • Priority: P4
  • Status: Closed
  • Resolution: Delivered
  • Submitted: 2016-05-12
  • Updated: 2022-06-14
  • Resolved: 2017-03-31
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7 JDK 8 JDK 9
7u111Resolved 8u102Resolved 9Resolved
Description
This enhancement provides a way to specify more granular levels for the GC verification enabled using the "VerifyBeforeGC", "VerifyAfterGC" and "VerifyDuringGC" diagnostic options. It introduces a new diagnostic option VerifySubSet using which one can specify the subset of the memory system that should be verified. 

With this new option, one or more sub-systems can be specified in a comma separated string. Valid memory sub-systems are: threads, heap, symbol_table, string_table, codecache, dictionary, classloader_data_graph, metaspace, jni_handles, c-heap and codecache_oops.
 
During the GC verification, only the sub-systems specified using VerifySubSet get verified:
 ```
D:\tests>java -XX:+UnlockDiagnosticVMOptions -XX:+VerifyBeforeGC -XX:VerifySubSet="threads,c-heap" -Xlog:gc+verify=debug Test
[0.095s][debug  ][gc,verify] Threads
[0.099s][debug  ][gc,verify] C-heap
[0.105s][info   ][gc,verify] Verifying Before GC (0.095s, 0.105s) 10.751ms
[0.120s][debug  ][gc,verify] Threads
[0.124s][debug  ][gc,verify] C-heap
[0.130s][info   ][gc,verify] Verifying Before GC (0.120s, 0.130s) 9.951ms
[0.148s][debug  ][gc,verify] Threads
[0.152s][debug  ][gc,verify] C-heap
```
If any invalid memory sub-systems are specified with VerifySubSet, Java process exits with the following error message:
```
D:\tests>java -XX:+UnlockDiagnosticVMOptions -XX:+VerifyBeforeGC -XX:VerifySubSet="threads,c-heap,hello" -Xlog:gc+verify=debug oom
Error occurred during initialization of VM
VerifySubSet: 'hello' memory sub-system is unknown, please correct it
```