8342182: G1: G1OldGenAllocationTracker does not account for direct allocations in regions

Reviewed-by: tschatzl, sjohanss
This commit is contained in:
Ivan Walulya 2024-10-22 13:13:04 +00:00
parent 3b71657f59
commit f70ecc27a7
3 changed files with 8 additions and 7 deletions

@ -2595,8 +2595,9 @@ void G1CollectedHeap::set_young_gen_card_set_stats(const G1MonotonicArenaMemoryS
}
void G1CollectedHeap::record_obj_copy_mem_stats() {
size_t total_old_allocated = _old_evac_stats.allocated() + _old_evac_stats.direct_allocated();
policy()->old_gen_alloc_tracker()->
add_allocated_bytes_since_last_gc(_old_evac_stats.allocated() * HeapWordSize);
add_allocated_bytes_since_last_gc(total_old_allocated * HeapWordSize);
_gc_tracer_stw->report_evacuation_statistics(create_g1_evac_summary(&_survivor_evac_stats),
create_g1_evac_summary(&_old_evac_stats));

@ -151,7 +151,7 @@ double G1AdaptiveIHOPControl::last_mutator_period_old_allocation_rate() const {
assert(_last_allocation_time_s > 0, "This should not be called when the last GC is full");
return _old_gen_alloc_tracker->last_period_old_gen_growth() / _last_allocation_time_s;
}
}
void G1AdaptiveIHOPControl::update_allocation_info(double allocation_time_s,
size_t additional_buffer_size) {

@ -32,17 +32,17 @@ class G1AdaptiveIHOPControl;
// Track allocation details in the old generation.
class G1OldGenAllocationTracker : public CHeapObj<mtGC> {
// Total number of bytes allocated in the old generation during
// last mutator period.
// Total number of bytes allocated in the old generation at the end
// of the last gc.
size_t _last_period_old_gen_bytes;
// Total growth of the old geneneration for last mutator period,
// taking eager reclaim into consideration.
// Total growth of the old geneneration since the last gc,
// taking eager-reclaim into consideration.
size_t _last_period_old_gen_growth;
// Total size of humongous objects for last gc.
size_t _humongous_bytes_after_last_gc;
// Non-humongous old generation allocations during last mutator period.
// Non-humongous old generation allocations since the last gc.
size_t _allocated_bytes_since_last_gc;
// Humongous allocations during last mutator period.
size_t _allocated_humongous_bytes_since_last_gc;