Skip to content

Add missing GC causes from gcCause.cpp#420

Merged
kcpeppe merged 1 commit intomicrosoft:mainfrom
j-bahr:add-gc-causes
Mar 3, 2025
Merged

Add missing GC causes from gcCause.cpp#420
kcpeppe merged 1 commit intomicrosoft:mainfrom
j-bahr:add-gc-causes

Conversation

@j-bahr
Copy link
Collaborator

@j-bahr j-bahr commented Feb 28, 2025

  1. Adding new GC causes from /src/jdk/src/hotspot/share/gc/shared/gcCause.cpp in JDK 21. This may help fix issues similar to what was seen in ZGC events GarbageCollectionType comes "Unknown" #380.

  2. Create GCCauses map programmatically from enum value list. This is less error prone in the event of adding causes.

1) Adding new GC causes from /src/jdk/src/hotspot/share/gc/shared/gcCause.cpp in JDK 21. This may help fix issues seen in microsoft#382.

2) Create GCCauses map programmatically from enum value list. This is less error prone in the event of adding causes.
// 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19
{ 4, 0, 2, 0, 0, 2, 0, 2, 2, 2, 0, 0, 2, 2, 0, 0, 0, 0, 2, 0},
{1130, 141, 146, 0, 0, 146, 0, 146, 0, 146, 1, 0, 146, 146, 0, 0, 16, 146, 146, 0},
{1130, 141, 146, 0, 1, 146, 0, 146, 0, 146, 0, 0, 146, 146, 0, 0, 16, 146, 146, 0},
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes caught a bug in the G1 test, where the line

[226.179s][info ][gc,start      ] GC(1198) Pause Full (Diagnostic Command)

Was not being identified correctly. Diagnostic Command was not in the GCCauses map and it was identified as a System.gc(). The fix now picks this up as Full GC type. The result is the the counts now differ after these changes.

@karianna karianna requested review from dsgrieve and kcpeppe March 2, 2025 23:40
@kcpeppe kcpeppe merged commit ce45b93 into microsoft:main Mar 3, 2025
8 checks passed
@karianna karianna mentioned this pull request Apr 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants