Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8268122: Add specific gc cause for G1 full collections #4357

Closed
wants to merge 5 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -1139,6 +1139,7 @@ void G1CollectedHeap::do_full_collection(bool clear_all_soft_refs) {
}

bool G1CollectedHeap::upgrade_to_full_collection() {
GCCauseSetter compaction(this, GCCause::_g1_compaction_pause);
log_info(gc, ergo)("Attempting full compaction clearing soft references");
bool success = do_full_collection(false /* explicit gc */,
true /* clear_all_soft_refs */,
@@ -1188,6 +1189,7 @@ HeapWord* G1CollectedHeap::satisfy_failed_allocation_helper(size_t word_size,
}

if (do_gc) {
GCCauseSetter compaction(this, GCCause::_g1_compaction_pause);
// Expansion didn't work, we'll try to do a Full GC.
// If maximum_compaction is set we clear all soft references and don't
// allow any dead wood to be left on the heap.
@@ -93,6 +93,9 @@ const char* GCCause::to_string(GCCause::Cause cause) {
case _g1_inc_collection_pause:
return "G1 Evacuation Pause";

case _g1_compaction_pause:
return "G1 Compaction Pause";

case _g1_humongous_allocation:
return "G1 Humongous Allocation";

@@ -71,6 +71,7 @@ class GCCause : public AllStatic {
_adaptive_size_policy,

_g1_inc_collection_pause,
_g1_compaction_pause,
_g1_humongous_allocation,
_g1_periodic_collection,
_g1_preventive_collection,
@@ -40,7 +40,7 @@ public static void main(String[] args) throws Exception {
String testID = "G1ConcurrentMark";
String[] vmFlags = {"-XX:+UseG1GC", "-XX:+ExplicitGCInvokesConcurrent"};
String[] gcNames = {GCHelper.gcG1New, GCHelper.gcG1Old, GCHelper.gcG1Full};
String[] gcCauses = {"G1 Evacuation Pause", "G1 Preventive Collection", "Allocation Failure", "System.gc()"};
String[] gcCauses = {"G1 Evacuation Pause", "G1 Preventive Collection", "G1 Compaction Pause", "System.gc()"};
GCGarbageCollectionUtil.test(testID, vmFlags, gcNames, gcCauses);
}
}
@@ -40,7 +40,7 @@ public static void main(String[] args) throws Exception {
String testID = "G1FullCollection";
String[] vmFlags = {"-XX:+UseG1GC"};
String[] gcNames = {GCHelper.gcG1New, GCHelper.gcG1Old, GCHelper.gcG1Full};
String[] gcCauses = {"G1 Evacuation Pause", "G1 Preventive Collection", "Allocation Failure", "System.gc()"};
String[] gcCauses = {"G1 Evacuation Pause", "G1 Preventive Collection", "G1 Compaction Pause", "System.gc()"};
GCGarbageCollectionUtil.test(testID, vmFlags, gcNames, gcCauses);
}
}