76 if (PrintTLAB && Verbose) { 77 gclog_or_tty->print_cr("ThreadLocalAllocBuffer::compute_size(" SIZE_FORMAT ")" 78 " returns " SIZE_FORMAT, 79 obj_size, new_tlab_size); 80 } 81 return new_tlab_size; 82 } 83 84 85 void ThreadLocalAllocBuffer::record_slow_allocation(size_t obj_size) { 86 // Raise size required to bypass TLAB next time. Why? Else there's 87 // a risk that a thread that repeatedly allocates objects of one 88 // size will get stuck on this slow path. 89 90 set_refill_waste_limit(refill_waste_limit() + refill_waste_limit_increment()); 91 92 _slow_allocations++; 93 94 if (PrintTLAB && Verbose) { 95 Thread* thrd = myThread(); 96 gclog_or_tty->print("TLAB: %s thread: "INTPTR_FORMAT" [id: %2d]" 97 " obj: "SIZE_FORMAT 98 " free: "SIZE_FORMAT 99 " waste: "SIZE_FORMAT"\n", 100 "slow", p2i(thrd), thrd->osthread()->thread_id(), 101 obj_size, free(), refill_waste_limit()); 102 } 103 } 104 105 #endif // SHARE_VM_GC_SHARED_THREADLOCALALLOCBUFFER_INLINE_HPP | 76 if (PrintTLAB && Verbose) { 77 gclog_or_tty->print_cr("ThreadLocalAllocBuffer::compute_size(" SIZE_FORMAT ")" 78 " returns " SIZE_FORMAT, 79 obj_size, new_tlab_size); 80 } 81 return new_tlab_size; 82 } 83 84 85 void ThreadLocalAllocBuffer::record_slow_allocation(size_t obj_size) { 86 // Raise size required to bypass TLAB next time. Why? Else there's 87 // a risk that a thread that repeatedly allocates objects of one 88 // size will get stuck on this slow path. 89 90 set_refill_waste_limit(refill_waste_limit() + refill_waste_limit_increment()); 91 92 _slow_allocations++; 93 94 if (PrintTLAB && Verbose) { 95 Thread* thrd = myThread(); 96 gclog_or_tty->print("TLAB: %s thread: " INTPTR_FORMAT " [id: %2d]" 97 " obj: " SIZE_FORMAT 98 " free: " SIZE_FORMAT 99 " waste: " SIZE_FORMAT "\n", 100 "slow", p2i(thrd), thrd->osthread()->thread_id(), 101 obj_size, free(), refill_waste_limit()); 102 } 103 } 104 105 #endif // SHARE_VM_GC_SHARED_THREADLOCALALLOCBUFFER_INLINE_HPP |