src/hotspot/share/gc/shenandoah/shenandoahPacer.cpp
changeset 54477 511be32f3863
parent 54017 274361bd6915
child 54833 76751d3faf7b
equal deleted inserted replaced
54476:20f7bbfc61d3 54477:511be32f3863
   151  */
   151  */
   152 
   152 
   153 void ShenandoahPacer::setup_for_idle() {
   153 void ShenandoahPacer::setup_for_idle() {
   154   assert(ShenandoahPacing, "Only be here when pacing is enabled");
   154   assert(ShenandoahPacing, "Only be here when pacing is enabled");
   155 
   155 
   156   size_t initial = _heap->capacity() * ShenandoahPacingIdleSlack / 100;
   156   size_t initial = _heap->max_capacity() * ShenandoahPacingIdleSlack / 100;
   157   double tax = 1;
   157   double tax = 1;
   158 
   158 
   159   restart_with(initial, tax);
   159   restart_with(initial, tax);
   160 
   160 
   161   log_info(gc, ergo)("Pacer for Idle. Initial: " SIZE_FORMAT "M, Alloc Tax Rate: %.1fx",
   161   log_info(gc, ergo)("Pacer for Idle. Initial: " SIZE_FORMAT "M, Alloc Tax Rate: %.1fx",
   164 
   164 
   165 size_t ShenandoahPacer::update_and_get_progress_history() {
   165 size_t ShenandoahPacer::update_and_get_progress_history() {
   166   if (_progress == -1) {
   166   if (_progress == -1) {
   167     // First initialization, report some prior
   167     // First initialization, report some prior
   168     Atomic::store((intptr_t)PACING_PROGRESS_ZERO, &_progress);
   168     Atomic::store((intptr_t)PACING_PROGRESS_ZERO, &_progress);
   169     return (size_t) (_heap->capacity() * 0.1);
   169     return (size_t) (_heap->max_capacity() * 0.1);
   170   } else {
   170   } else {
   171     // Record history, and reply historical data
   171     // Record history, and reply historical data
   172     _progress_history->add(_progress);
   172     _progress_history->add(_progress);
   173     Atomic::store((intptr_t)PACING_PROGRESS_ZERO, &_progress);
   173     Atomic::store((intptr_t)PACING_PROGRESS_ZERO, &_progress);
   174     return (size_t) (_progress_history->avg() * HeapWordSize);
   174     return (size_t) (_progress_history->avg() * HeapWordSize);