Skip to content

Commit 231d9a0

Browse files
committedMay 31, 2020
8246044: ZGC: Rename ZDirector's max_capacity to soft_max_capacity
Reviewed-by: stefank, eosterlund
1 parent 116aee4 commit 231d9a0

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed
 

‎src/hotspot/share/gc/z/zDirector.cpp

+7-7
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,10 @@ bool ZDirector::rule_warmup() const {
7373
// Perform GC if heap usage passes 10/20/30% and no other GC has been
7474
// performed yet. This allows us to get some early samples of the GC
7575
// duration, which is needed by the other rules.
76-
const size_t max_capacity = ZHeap::heap()->soft_max_capacity();
76+
const size_t soft_max_capacity = ZHeap::heap()->soft_max_capacity();
7777
const size_t used = ZHeap::heap()->used();
7878
const double used_threshold_percent = (ZStatCycle::nwarmup_cycles() + 1) * 0.1;
79-
const size_t used_threshold = max_capacity * used_threshold_percent;
79+
const size_t used_threshold = soft_max_capacity * used_threshold_percent;
8080

8181
log_debug(gc, director)("Rule: Warmup %.0f%%, Used: " SIZE_FORMAT "MB, UsedThreshold: " SIZE_FORMAT "MB",
8282
used_threshold_percent * 100, used / M, used_threshold / M);
@@ -99,10 +99,10 @@ bool ZDirector::rule_allocation_rate() const {
9999
// Calculate amount of free memory available to Java threads. Note that
100100
// the heap reserve is not available to Java threads and is therefore not
101101
// considered part of the free memory.
102-
const size_t max_capacity = ZHeap::heap()->soft_max_capacity();
102+
const size_t soft_max_capacity = ZHeap::heap()->soft_max_capacity();
103103
const size_t max_reserve = ZHeap::heap()->max_reserve();
104104
const size_t used = ZHeap::heap()->used();
105-
const size_t free_with_reserve = max_capacity - MIN2(max_capacity, used);
105+
const size_t free_with_reserve = soft_max_capacity - MIN2(soft_max_capacity, used);
106106
const size_t free = free_with_reserve - MIN2(free_with_reserve, max_reserve);
107107

108108
// Calculate time until OOM given the max allocation rate and the amount
@@ -183,12 +183,12 @@ bool ZDirector::rule_high_usage() const {
183183
// Calculate amount of free memory available to Java threads. Note that
184184
// the heap reserve is not available to Java threads and is therefore not
185185
// considered part of the free memory.
186-
const size_t max_capacity = ZHeap::heap()->soft_max_capacity();
186+
const size_t soft_max_capacity = ZHeap::heap()->soft_max_capacity();
187187
const size_t max_reserve = ZHeap::heap()->max_reserve();
188188
const size_t used = ZHeap::heap()->used();
189-
const size_t free_with_reserve = max_capacity - used;
189+
const size_t free_with_reserve = soft_max_capacity - used;
190190
const size_t free = free_with_reserve - MIN2(free_with_reserve, max_reserve);
191-
const double free_percent = percent_of(free, max_capacity);
191+
const double free_percent = percent_of(free, soft_max_capacity);
192192

193193
log_debug(gc, director)("Rule: High Usage, Free: " SIZE_FORMAT "MB(%.1f%%)",
194194
free / M, free_percent);

0 commit comments

Comments
 (0)
Please sign in to comment.