Skip to content

Commit

Permalink
Update generational mode to use log status under lock
Browse files Browse the repository at this point in the history
  • Loading branch information
earthling-amzn committed Oct 1, 2024
1 parent 38ca9a8 commit d4ee79e
Showing 1 changed file with 9 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,8 @@ void ShenandoahGenerationalControlThread::run_service() {
heap->set_forced_counters_update(true);

// If GC was requested, we better dump freeset data for performance debugging
{
ShenandoahHeapLocker locker(heap->lock());
heap->free_set()->log_status();
}
heap->free_set()->log_status_under_lock();

// In case this is a degenerated cycle, remember whether original cycle was aging.
const bool was_aging_cycle = heap->is_aging_cycle();
heap->set_aging_cycle(false);
Expand Down Expand Up @@ -265,18 +263,15 @@ void ShenandoahGenerationalControlThread::run_service() {

// Report current free set state at the end of cycle, whether
// it is a normal completion, or the abort.
{
ShenandoahHeapLocker locker(heap->lock());
heap->free_set()->log_status();
heap->free_set()->log_status_under_lock();

// Notify Universe about new heap usage. This has implications for
// global soft refs policy, and we better report it every time heap
// usage goes down.
heap->update_capacity_and_used_at_gc();
// Notify Universe about new heap usage. This has implications for
// global soft refs policy, and we better report it every time heap
// usage goes down.
heap->update_capacity_and_used_at_gc();

// Signal that we have completed a visit to all live objects.
heap->record_whole_heap_examined_timestamp();
}
// Signal that we have completed a visit to all live objects.
heap->record_whole_heap_examined_timestamp();

// Disable forced counters update, and update counters one more time
// to capture the state at the end of GC session.
Expand Down

0 comments on commit d4ee79e

Please sign in to comment.