< prev index next >

src/hotspot/share/gc/shared/threadLocalAllocBuffer.cpp

Print this page




  74     }
  75 
  76     stats->update_fast_allocations(_number_of_refills,
  77                                    _allocated_size,
  78                                    _gc_waste,
  79                                    _fast_refill_waste,
  80                                    _slow_refill_waste);
  81   } else {
  82     assert(_number_of_refills == 0 && _fast_refill_waste == 0 &&
  83            _slow_refill_waste == 0 && _gc_waste          == 0,
  84            "tlab stats == 0");
  85   }
  86 
  87   stats->update_slow_allocations(_slow_allocations);
  88 
  89   reset_statistics();
  90 }
  91 
  92 void ThreadLocalAllocBuffer::insert_filler() {
  93   assert(end() != NULL, "Must not be retired");
  94   Universe::heap()->fill_with_dummy_object(top(), hard_end(), true);
  95 }
  96 
  97 void ThreadLocalAllocBuffer::make_parsable() {
  98   if (end() != NULL) {
  99     invariants();
 100     if (ZeroTLAB) {
 101       retire();
 102     } else {
 103       insert_filler();
 104     }
 105   }
 106 }
 107 
 108 void ThreadLocalAllocBuffer::retire(ThreadLocalAllocStats* stats) {
 109   if (stats != NULL) {
 110     accumulate_and_reset_statistics(stats);
 111   }
 112 
 113   if (end() != NULL) {
 114     invariants();


 444                       _allocating_threads, _total_refills, _max_refills,
 445                       _total_slow_allocations, _max_slow_allocations, waste_percent,
 446                       _total_gc_waste * HeapWordSize, _max_gc_waste * HeapWordSize,
 447                       _total_slow_refill_waste * HeapWordSize, _max_slow_refill_waste * HeapWordSize,
 448                       _total_fast_refill_waste * HeapWordSize, _max_fast_refill_waste * HeapWordSize);
 449 
 450   if (UsePerfData) {
 451     _perf_allocating_threads      ->set_value(_allocating_threads);
 452     _perf_total_refills           ->set_value(_total_refills);
 453     _perf_max_refills             ->set_value(_max_refills);
 454     _perf_total_allocations       ->set_value(_total_allocations);
 455     _perf_total_gc_waste          ->set_value(_total_gc_waste);
 456     _perf_max_gc_waste            ->set_value(_max_gc_waste);
 457     _perf_total_slow_refill_waste ->set_value(_total_slow_refill_waste);
 458     _perf_max_slow_refill_waste   ->set_value(_max_slow_refill_waste);
 459     _perf_total_fast_refill_waste ->set_value(_total_fast_refill_waste);
 460     _perf_max_fast_refill_waste   ->set_value(_max_fast_refill_waste);
 461     _perf_total_slow_allocations  ->set_value(_total_slow_allocations);
 462     _perf_max_slow_allocations    ->set_value(_max_slow_allocations);
 463   }
 464 }
 465 
 466 size_t ThreadLocalAllocBuffer::end_reserve() {
 467   size_t reserve_size = Universe::heap()->tlab_alloc_reserve();
 468   return MAX2(reserve_size, (size_t)_reserve_for_allocation_prefetch);
 469 }


  74     }
  75 
  76     stats->update_fast_allocations(_number_of_refills,
  77                                    _allocated_size,
  78                                    _gc_waste,
  79                                    _fast_refill_waste,
  80                                    _slow_refill_waste);
  81   } else {
  82     assert(_number_of_refills == 0 && _fast_refill_waste == 0 &&
  83            _slow_refill_waste == 0 && _gc_waste          == 0,
  84            "tlab stats == 0");
  85   }
  86 
  87   stats->update_slow_allocations(_slow_allocations);
  88 
  89   reset_statistics();
  90 }
  91 
  92 void ThreadLocalAllocBuffer::insert_filler() {
  93   assert(end() != NULL, "Must not be retired");
  94   Fill::range(top(), hard_end());
  95 }
  96 
  97 void ThreadLocalAllocBuffer::make_parsable() {
  98   if (end() != NULL) {
  99     invariants();
 100     if (ZeroTLAB) {
 101       retire();
 102     } else {
 103       insert_filler();
 104     }
 105   }
 106 }
 107 
 108 void ThreadLocalAllocBuffer::retire(ThreadLocalAllocStats* stats) {
 109   if (stats != NULL) {
 110     accumulate_and_reset_statistics(stats);
 111   }
 112 
 113   if (end() != NULL) {
 114     invariants();


 444                       _allocating_threads, _total_refills, _max_refills,
 445                       _total_slow_allocations, _max_slow_allocations, waste_percent,
 446                       _total_gc_waste * HeapWordSize, _max_gc_waste * HeapWordSize,
 447                       _total_slow_refill_waste * HeapWordSize, _max_slow_refill_waste * HeapWordSize,
 448                       _total_fast_refill_waste * HeapWordSize, _max_fast_refill_waste * HeapWordSize);
 449 
 450   if (UsePerfData) {
 451     _perf_allocating_threads      ->set_value(_allocating_threads);
 452     _perf_total_refills           ->set_value(_total_refills);
 453     _perf_max_refills             ->set_value(_max_refills);
 454     _perf_total_allocations       ->set_value(_total_allocations);
 455     _perf_total_gc_waste          ->set_value(_total_gc_waste);
 456     _perf_max_gc_waste            ->set_value(_max_gc_waste);
 457     _perf_total_slow_refill_waste ->set_value(_total_slow_refill_waste);
 458     _perf_max_slow_refill_waste   ->set_value(_max_slow_refill_waste);
 459     _perf_total_fast_refill_waste ->set_value(_total_fast_refill_waste);
 460     _perf_max_fast_refill_waste   ->set_value(_max_fast_refill_waste);
 461     _perf_total_slow_allocations  ->set_value(_total_slow_allocations);
 462     _perf_max_slow_allocations    ->set_value(_max_slow_allocations);
 463   }





 464 }
< prev index next >