Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
8255765: Shenandoah: Isolate concurrent, degenerated and full GC
Reviewed-by: rkennke, shade
  • Loading branch information
zhengyu123 committed Jan 21, 2021
1 parent c3c6662 commit 34eb8b3
Show file tree
Hide file tree
Showing 20 changed files with 1,938 additions and 1,416 deletions.
13 changes: 7 additions & 6 deletions src/hotspot/share/gc/shenandoah/shenandoahCollectorPolicy.cpp
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2019, Red Hat, Inc. All rights reserved.
* Copyright (c) 2013, 2021, Red Hat, Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand All @@ -25,6 +25,7 @@
#include "precompiled.hpp"

#include "gc/shenandoah/shenandoahCollectorPolicy.hpp"
#include "gc/shenandoah/shenandoahGC.hpp"
#include "gc/shenandoah/shenandoahHeap.inline.hpp"
#include "runtime/os.hpp"

Expand All @@ -41,7 +42,7 @@ ShenandoahCollectorPolicy::ShenandoahCollectorPolicy() :
_implicit_full(0),
_cycle_counter(0) {

Copy::zero_to_bytes(_degen_points, sizeof(size_t) * ShenandoahHeap::_DEGENERATED_LIMIT);
Copy::zero_to_bytes(_degen_points, sizeof(size_t) * ShenandoahGC::_DEGENERATED_LIMIT);

_tracer = new (ResourceObj::C_HEAP, mtGC) ShenandoahTracer();

Expand All @@ -67,8 +68,8 @@ void ShenandoahCollectorPolicy::record_alloc_failure_to_full() {
_alloc_failure_full++;
}

void ShenandoahCollectorPolicy::record_alloc_failure_to_degenerated(ShenandoahHeap::ShenandoahDegenPoint point) {
assert(point < ShenandoahHeap::_DEGENERATED_LIMIT, "sanity");
void ShenandoahCollectorPolicy::record_alloc_failure_to_degenerated(ShenandoahGC::ShenandoahDegenPoint point) {
assert(point < ShenandoahGC::_DEGENERATED_LIMIT, "sanity");
_alloc_failure_degenerated++;
_degen_points[point]++;
}
Expand Down Expand Up @@ -119,9 +120,9 @@ void ShenandoahCollectorPolicy::print_gc_stats(outputStream* out) const {

out->print_cr(SIZE_FORMAT_W(5) " Degenerated GCs", _success_degenerated_gcs);
out->print_cr(" " SIZE_FORMAT_W(5) " caused by allocation failure", _alloc_failure_degenerated);
for (int c = 0; c < ShenandoahHeap::_DEGENERATED_LIMIT; c++) {
for (int c = 0; c < ShenandoahGC::_DEGENERATED_LIMIT; c++) {
if (_degen_points[c] > 0) {
const char* desc = ShenandoahHeap::degen_point_to_string((ShenandoahHeap::ShenandoahDegenPoint)c);
const char* desc = ShenandoahGC::degen_point_to_string((ShenandoahGC::ShenandoahDegenPoint)c);
out->print_cr(" " SIZE_FORMAT_W(5) " happened at %s", _degen_points[c], desc);
}
}
Expand Down
9 changes: 5 additions & 4 deletions src/hotspot/share/gc/shenandoah/shenandoahCollectorPolicy.hpp
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2019, Red Hat, Inc. All rights reserved.
* Copyright (c) 2013, 2021, Red Hat, Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand All @@ -26,7 +26,8 @@
#define SHARE_GC_SHENANDOAH_SHENANDOAHCOLLECTORPOLICY_HPP

#include "gc/shared/gcTrace.hpp"
#include "gc/shenandoah/shenandoahHeap.hpp"
#include "gc/shenandoah/shenandoahGC.hpp"
#include "gc/shenandoah/shenandoahSharedVariables.hpp"
#include "memory/allocation.hpp"
#include "utilities/ostream.hpp"

Expand All @@ -47,7 +48,7 @@ class ShenandoahCollectorPolicy : public CHeapObj<mtGC> {
size_t _explicit_full;
size_t _implicit_concurrent;
size_t _implicit_full;
size_t _degen_points[ShenandoahHeap::_DEGENERATED_LIMIT];
size_t _degen_points[ShenandoahGC::_DEGENERATED_LIMIT];

ShenandoahSharedFlag _in_shutdown;

Expand All @@ -65,7 +66,7 @@ class ShenandoahCollectorPolicy : public CHeapObj<mtGC> {
void record_success_concurrent();
void record_success_degenerated();
void record_success_full();
void record_alloc_failure_to_degenerated(ShenandoahHeap::ShenandoahDegenPoint point);
void record_alloc_failure_to_degenerated(ShenandoahGC::ShenandoahDegenPoint point);
void record_alloc_failure_to_full();
void record_degenerated_upgrade_to_full();
void record_explicit_to_concurrent();
Expand Down

1 comment on commit 34eb8b3

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

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

Please sign in to comment.