mirror of
https://github.com/openjdk/jdk.git
synced 2026-04-16 18:00:29 +00:00
nit: comments to explain why mutator_allocator_remaining_bytes needs to be added back when reset bytes_allocated_since_gc_start
This commit is contained in:
parent
d6543f9006
commit
08b4245d70
@ -694,6 +694,7 @@ public:
|
||||
// Return an approximation of the bytes allocated since GC start. The value returned is monotonically non-decreasing
|
||||
// in time within each GC cycle. For certain GC cycles, the value returned may include some bytes allocated before
|
||||
// the start of the current GC cycle.
|
||||
// Bytes allocated since gc start includes the total unused bytes in mutator allocator reserved for CAS allocation.
|
||||
inline size_t get_bytes_allocated_since_gc_start() const {
|
||||
return _mutator_bytes_allocated_since_gc_start;
|
||||
}
|
||||
|
||||
@ -2293,6 +2293,7 @@ void ShenandoahHeap::reset_bytes_allocated_since_gc_start() {
|
||||
// Single-gen Shenandoah uses global heuristics.
|
||||
unaccounted_bytes = heuristics()->force_alloc_rate_sample(actual_allocated);
|
||||
}
|
||||
// Bytes allocated since gc start includes the total unused bytes in mutator allocator reserved for CAS allocation.
|
||||
_free_set->reset_bytes_allocated_since_gc_start(unaccounted_bytes + mutator_allocator_remaining_bytes);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user