src/hotspot/share/gc/shenandoah/heuristics/shenandoahCompactHeuristics.cpp
changeset 54477 511be32f3863
parent 54423 6c0ab8bd8da5
child 54833 76751d3faf7b
equal deleted inserted replaced
54476:20f7bbfc61d3 54477:511be32f3863
    51 
    51 
    52 bool ShenandoahCompactHeuristics::should_start_normal_gc() const {
    52 bool ShenandoahCompactHeuristics::should_start_normal_gc() const {
    53   ShenandoahHeap* heap = ShenandoahHeap::heap();
    53   ShenandoahHeap* heap = ShenandoahHeap::heap();
    54 
    54 
    55   size_t available = heap->free_set()->available();
    55   size_t available = heap->free_set()->available();
    56   size_t threshold_bytes_allocated = heap->capacity() * ShenandoahAllocationThreshold / 100;
    56   size_t threshold_bytes_allocated = heap->max_capacity() * ShenandoahAllocationThreshold / 100;
    57   size_t min_threshold = ShenandoahMinFreeThreshold * heap->capacity() / 100;
    57   size_t min_threshold = ShenandoahMinFreeThreshold * heap->max_capacity() / 100;
    58 
    58 
    59   if (available < min_threshold) {
    59   if (available < min_threshold) {
    60     log_info(gc)("Trigger: Free (" SIZE_FORMAT "M) is below minimum threshold (" SIZE_FORMAT "M)",
    60     log_info(gc)("Trigger: Free (" SIZE_FORMAT "M) is below minimum threshold (" SIZE_FORMAT "M)",
    61                  available / M, min_threshold / M);
    61                  available / M, min_threshold / M);
    62     return true;
    62     return true;