Skip to content

JDK-8349077 : Rename GenerationCounters::update_all #25833

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

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/hotspot/share/gc/epsilon/epsilonMonitoringSupport.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2018, Red Hat, Inc. All rights reserved.
* Copyright (c) 2017, 2025, 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 Down Expand Up @@ -91,7 +91,7 @@ class EpsilonGenerationCounters : public GenerationCounters {
{};

void update_all() {
GenerationCounters::update_all(_heap->capacity());
GenerationCounters::update_capacity(_heap->capacity());
}
};

Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/share/gc/g1/g1MonitoringSupport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class G1YoungGenerationCounters : public G1GenerationCounters {

void update_all() {
size_t committed = _monitoring_support->young_gen_committed();
GenerationCounters::update_all(committed);
GenerationCounters::update_capacity(committed);
}
};

Expand All @@ -83,7 +83,7 @@ class G1OldGenerationCounters : public G1GenerationCounters {

void update_all() {
size_t committed = _monitoring_support->old_gen_committed();
GenerationCounters::update_all(committed);
GenerationCounters::update_capacity(committed);
}
};

Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/share/gc/parallel/psOldGen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ bool PSOldGen::expand_by(size_t bytes) {
post_resize();
if (UsePerfData) {
_space_counters->update_capacity();
_gen_counters->update_all(_virtual_space->committed_size());
_gen_counters->update_capacity(_virtual_space->committed_size());
}
}

Expand Down Expand Up @@ -366,7 +366,7 @@ void PSOldGen::print_on(outputStream* st) const {
void PSOldGen::update_counters() {
if (UsePerfData) {
_space_counters->update_all();
_gen_counters->update_all(_virtual_space->committed_size());
_gen_counters->update_capacity(_virtual_space->committed_size());
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/gc/parallel/psYoungGen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,7 @@ void PSYoungGen::update_counters() {
_eden_counters->update_all();
_from_counters->update_all();
_to_counters->update_all();
_gen_counters->update_all(_virtual_space->committed_size());
_gen_counters->update_capacity(_virtual_space->committed_size());
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/gc/serial/defNewGeneration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -814,7 +814,7 @@ void DefNewGeneration::update_counters() {
_eden_counters->update_all();
_from_counters->update_all();
_to_counters->update_all();
_gen_counters->update_all(_virtual_space.committed_size());
_gen_counters->update_capacity(_virtual_space.committed_size());
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/gc/serial/tenuredGeneration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ void TenuredGeneration::update_promote_stats() {
void TenuredGeneration::update_counters() {
if (UsePerfData) {
_space_counters->update_all();
_gen_counters->update_all(_virtual_space.committed_size());
_gen_counters->update_capacity(_virtual_space.committed_size());
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/gc/shared/generationCounters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ GenerationCounters::~GenerationCounters() {
FREE_C_HEAP_ARRAY(char, _name_space);
}

void GenerationCounters::update_all(size_t curr_capacity) {
void GenerationCounters::update_capacity(size_t curr_capacity) {
_current_size->set_value(curr_capacity);
}

4 changes: 2 additions & 2 deletions src/hotspot/share/gc/shared/generationCounters.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2025, Oracle and/or its affiliates. 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 Down Expand Up @@ -52,7 +52,7 @@ class GenerationCounters: public CHeapObj<mtGC> {

~GenerationCounters();

void update_all(size_t curr_capacity);
void update_capacity(size_t curr_capacity);

const char* name_space() const { return _name_space; }
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2019, Red Hat, Inc. All rights reserved.
* Copyright (c) 2015, 2025, 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 Down Expand Up @@ -51,7 +51,7 @@ class ShenandoahGenerationCounters : public GenerationCounters {
{};

void update_all() {
GenerationCounters::update_all(_heap->capacity());
GenerationCounters::update_capacity(_heap->capacity());
}
};

Expand Down
3 changes: 0 additions & 3 deletions src/hotspot/share/gc/z/zServiceability.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,6 @@ class ZGenerationCounters : public GenerationCounters {
max_capacity,
curr_capacity) {}

void update_capacity(size_t capacity) {
update_all(capacity);
}
Comment on lines -68 to -70
Copy link
Member

Choose a reason for hiding this comment

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

Could you also delete line 67.

Copy link
Member

Choose a reason for hiding this comment

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

Or maybe even better just entirely delete ZGenerationCounters and replace its usages with GenerationCounters.

};

// Class to expose perf counters used by jstat.
Expand Down