Skip to content

Commit 9439d76

Browse files
author
Thomas Schatzl
committed
8364532: G1: In liveness tracing, print more significant digits for the liveness value
Reviewed-by: ayang, iwalulya
1 parent b735ef9 commit 9439d76

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/hotspot/share/gc/g1/g1CollectionSetCandidates.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,9 @@ void G1CSetCandidateGroup::calculate_efficiency() {
6363
_gc_efficiency = _reclaimable_bytes / predict_group_total_time_ms();
6464
}
6565

66-
size_t G1CSetCandidateGroup::liveness() const {
66+
double G1CSetCandidateGroup::liveness_percent() const {
6767
size_t capacity = length() * G1HeapRegion::GrainBytes;
68-
69-
return (size_t) ceil(((capacity - _reclaimable_bytes) * 100.0) / capacity);
68+
return ((capacity - _reclaimable_bytes) * 100.0) / capacity;
7069
}
7170

7271
void G1CSetCandidateGroup::clear(bool uninstall_group_cardset) {

src/hotspot/share/gc/g1/g1CollectionSetCandidates.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ class G1CSetCandidateGroup : public CHeapObj<mtGCCardSet>{
102102

103103
void calculate_efficiency();
104104

105-
size_t liveness() const;
105+
double liveness_percent() const;
106106
// Comparison function to order regions in decreasing GC efficiency order. This
107107
// will cause regions with a lot of live objects and large remembered sets to end
108108
// up at the end of the list.

src/hotspot/share/gc/g1/g1ConcurrentMark.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2981,6 +2981,7 @@ G1CMTask::G1CMTask(uint worker_id,
29812981
#define G1PPRL_LEN_FORMAT " " UINT32_FORMAT_W(14)
29822982
#define G1PPRL_LEN_H_FORMAT " %14s"
29832983
#define G1PPRL_GID_GCEFF_FORMAT " %14.1f"
2984+
#define G1PPRL_GID_LIVENESS_FORMAT " %9.2f"
29842985

29852986
// For summary info
29862987
#define G1PPRL_SUM_ADDR_FORMAT(tag) " " tag ":" G1PPRL_ADDR_BASE_FORMAT
@@ -3114,13 +3115,13 @@ void G1PrintRegionLivenessInfoClosure::log_cset_candidate_group_add_total(G1CSet
31143115
G1PPRL_GID_FORMAT
31153116
G1PPRL_LEN_FORMAT
31163117
G1PPRL_GID_GCEFF_FORMAT
3117-
G1PPRL_BYTE_FORMAT
3118+
G1PPRL_GID_LIVENESS_FORMAT
31183119
G1PPRL_BYTE_FORMAT
31193120
G1PPRL_TYPE_H_FORMAT,
31203121
group->group_id(),
31213122
group->length(),
31223123
group->gc_efficiency(),
3123-
group->liveness(),
3124+
group->liveness_percent(),
31243125
group->card_set()->mem_size(),
31253126
type);
31263127
_total_remset_bytes += group->card_set()->mem_size();

0 commit comments

Comments
 (0)