JDK-8360024 : Reorganize GC VM operations and implement is_gc_operation
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: gc
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2025-06-19
  • Updated: 2025-07-03
  • Resolved: 2025-06-23
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 26
26 b04Fixed
Related Reports
Blocks :  
Description
JDK-8359110 introduces a need to be able to categorize VM operations to be able to track GC activity in the VM thread for CPU time tracking. This patch will reorganize the shared GC VM operations in gcVMOperations.hpp to make a distinction between GC operations and serviceability/CDS etc. operations performed for the GC.

Additionally the ability to query is_gc_operation() is introduced in the base class VM_Operation and overridden in appropriate VM operations. This provides a clear and efficient interface to query the category of a VM operation.

Renaming VM_GC_Sync_Operation to VM_Heap_Sync_Operation to make it clear that all sub-classes is related to GC. While VM_GC_HeapInspection is a serviceability operation it attempts to trigger a collection, hence it is put underneath VM_GC_Collect_Operation->VM_GC_Service_Operation. However only classes that inherits from VM_GC_Collect_Operation are considered to return true for is_gc_operation() as VM_GC_HeapInspection is considered to not belong to "GC activity".

ZGC and Shenandoah do not use sub-classing of VM_Heap_Sync_Operation, but their respective base classes and special classes for GC activity are marked as returning true for is_gc_operation().

The only is_XX_operation that is specified in VM_Operation is is_gc_operation to not clutter with cases that are not used (is_gc_operation will be used by JDK-8359110). That being said, these behavioral queries may be extended in case we want to explore CPU time tracking beyond the GC component.
Comments
Changeset: c748d358 Branch: master Author: Jonas Norlinder <github.jonas.norlinder@norlinder.nu> Committer: Thomas Schatzl <tschatzl@openjdk.org> Date: 2025-06-23 12:49:59 +0000 URL: https://git.openjdk.org/jdk/commit/c748d358b2569928fb5a03722987c93762c30145
23-06-2025

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/25896 Date: 2025-06-19 11:26:26 +0000
19-06-2025