Skip to content

Commit

Permalink
8330960: Serial: Remove SerialFullGC::_total_invocations
Browse files Browse the repository at this point in the history
Reviewed-by: ayang, tschatzl
  • Loading branch information
lgxbslgx committed Apr 29, 2024
1 parent 4edac34 commit 766d0b0
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
7 changes: 1 addition & 6 deletions src/hotspot/share/gc/serial/serialFullGC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,6 @@
#include "jvmci/jvmci.hpp"
#endif

uint SerialFullGC::_total_invocations = 0;

Stack<oop, mtGC> SerialFullGC::_marking_stack;
Stack<ObjArrayTask, mtGC> SerialFullGC::_objarray_stack;

Expand Down Expand Up @@ -113,7 +111,7 @@ class DeadSpacer : StackObj {
// we don't start compacting before there is a significant gain to be made.
// Occasionally, we want to ensure a full compaction, which is determined
// by the MarkSweepAlwaysCompactCount parameter.
if ((SerialFullGC::total_invocations() % MarkSweepAlwaysCompactCount) != 0) {
if ((SerialHeap::heap()->total_full_collections() % MarkSweepAlwaysCompactCount) != 0) {
_allowed_deadspace_words = (space->capacity() * ratio / 100) / HeapWordSize;
} else {
_active = false;
Expand Down Expand Up @@ -694,9 +692,6 @@ void SerialFullGC::invoke_at_safepoint(bool clear_all_softrefs) {

gch->trace_heap_before_gc(_gc_tracer);

// Increment the invocation count
_total_invocations++;

// Capture used regions for old-gen to reestablish old-to-young invariant
// after full-gc.
gch->old_gen()->save_used_region();
Expand Down
6 changes: 0 additions & 6 deletions src/hotspot/share/gc/serial/serialFullGC.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,6 @@ class SerialFullGC : AllStatic {
};

protected:
// Total invocations of serial full GC
static uint _total_invocations;

// Traversal stacks used during phase1
static Stack<oop, mtGC> _marking_stack;
static Stack<ObjArrayTask, mtGC> _objarray_stack;
Expand Down Expand Up @@ -119,9 +116,6 @@ class SerialFullGC : AllStatic {

static void invoke_at_safepoint(bool clear_all_softrefs);

// Accessors
static uint total_invocations() { return _total_invocations; }

// Reference Processing
static ReferenceProcessor* ref_processor() { return _ref_processor; }

Expand Down

1 comment on commit 766d0b0

@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.