< prev index next >

src/hotspot/share/gc/parallel/psScavenge.cpp

Print this page
rev 52961 : 8212206: Refactor AdaptiveSizePolicy to separate out code related to GC overhead
Summary: Move check_gc_overhead_limit() and related code to its own class
Reviewed-by:


 526             young_gen->to_space()->capacity_in_bytes(),
 527             "Sizes of space in young gen are out-of-bounds");
 528 
 529           size_t young_live = young_gen->used_in_bytes();
 530           size_t eden_live = young_gen->eden_space()->used_in_bytes();
 531           size_t cur_eden = young_gen->eden_space()->capacity_in_bytes();
 532           size_t max_old_gen_size = old_gen->max_gen_size();
 533           size_t max_eden_size = max_young_size -
 534             young_gen->from_space()->capacity_in_bytes() -
 535             young_gen->to_space()->capacity_in_bytes();
 536 
 537           // Used for diagnostics
 538           size_policy->clear_generation_free_space_flags();
 539 
 540           size_policy->compute_eden_space_size(young_live,
 541                                                eden_live,
 542                                                cur_eden,
 543                                                max_eden_size,
 544                                                false /* not full gc*/);
 545 
 546           size_policy->check_gc_overhead_limit(young_live,
 547                                                eden_live,
 548                                                max_old_gen_size,
 549                                                max_eden_size,
 550                                                false /* not full gc*/,
 551                                                gc_cause,
 552                                                heap->soft_ref_policy());
 553 
 554           size_policy->decay_supplemental_growth(false /* not full gc*/);
 555         }
 556         // Resize the young generation at every collection
 557         // even if new sizes have not been calculated.  This is
 558         // to allow resizes that may have been inhibited by the
 559         // relative location of the "to" and "from" spaces.
 560 
 561         // Resizing the old gen at young collections can cause increases
 562         // that don't feed back to the generation sizing policy until
 563         // a full collection.  Don't resize the old gen here.
 564 
 565         heap->resize_young_gen(size_policy->calculated_eden_size_in_bytes(),
 566                         size_policy->calculated_survivor_size_in_bytes());
 567 




 526             young_gen->to_space()->capacity_in_bytes(),
 527             "Sizes of space in young gen are out-of-bounds");
 528 
 529           size_t young_live = young_gen->used_in_bytes();
 530           size_t eden_live = young_gen->eden_space()->used_in_bytes();
 531           size_t cur_eden = young_gen->eden_space()->capacity_in_bytes();
 532           size_t max_old_gen_size = old_gen->max_gen_size();
 533           size_t max_eden_size = max_young_size -
 534             young_gen->from_space()->capacity_in_bytes() -
 535             young_gen->to_space()->capacity_in_bytes();
 536 
 537           // Used for diagnostics
 538           size_policy->clear_generation_free_space_flags();
 539 
 540           size_policy->compute_eden_space_size(young_live,
 541                                                eden_live,
 542                                                cur_eden,
 543                                                max_eden_size,
 544                                                false /* not full gc*/);
 545 
 546           size_policy->check_gc_overhead_limit(eden_live,

 547                                                max_old_gen_size,
 548                                                max_eden_size,
 549                                                false /* not full gc*/,
 550                                                gc_cause,
 551                                                heap->soft_ref_policy());
 552 
 553           size_policy->decay_supplemental_growth(false /* not full gc*/);
 554         }
 555         // Resize the young generation at every collection
 556         // even if new sizes have not been calculated.  This is
 557         // to allow resizes that may have been inhibited by the
 558         // relative location of the "to" and "from" spaces.
 559 
 560         // Resizing the old gen at young collections can cause increases
 561         // that don't feed back to the generation sizing policy until
 562         // a full collection.  Don't resize the old gen here.
 563 
 564         heap->resize_young_gen(size_policy->calculated_eden_size_in_bytes(),
 565                         size_policy->calculated_survivor_size_in_bytes());
 566 


< prev index next >