< prev index next >

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

Print this page
rev 11777 : [mq]: gcinterface.patch

*** 60,71 **** } } void ThreadLocalAllocBuffer::accumulate_statistics() { Thread* thread = myThread(); ! size_t capacity = Universe::heap()->tlab_capacity(thread); ! size_t used = Universe::heap()->tlab_used(thread); _gc_waste += (unsigned)remaining(); size_t total_allocated = thread->allocated_bytes(); size_t allocated_since_last_gc = total_allocated - _allocated_before_last_gc; _allocated_before_last_gc = total_allocated; --- 60,71 ---- } } void ThreadLocalAllocBuffer::accumulate_statistics() { Thread* thread = myThread(); ! size_t capacity = GC::gc()->heap()->tlab_capacity(thread); ! size_t used = GC::gc()->heap()->tlab_used(thread); _gc_waste += (unsigned)remaining(); size_t total_allocated = thread->allocated_bytes(); size_t allocated_since_last_gc = total_allocated - _allocated_before_last_gc; _allocated_before_last_gc = total_allocated;
*** 138,148 **** void ThreadLocalAllocBuffer::resize() { // Compute the next tlab size using expected allocation amount assert(ResizeTLAB, "Should not call this otherwise"); size_t alloc = (size_t)(_allocation_fraction.average() * ! (Universe::heap()->tlab_capacity(myThread()) / HeapWordSize)); size_t new_size = alloc / _target_refills; new_size = MIN2(MAX2(new_size, min_size()), max_size()); size_t aligned_new_size = align_object_size(new_size); --- 138,148 ---- void ThreadLocalAllocBuffer::resize() { // Compute the next tlab size using expected allocation amount assert(ResizeTLAB, "Should not call this otherwise"); size_t alloc = (size_t)(_allocation_fraction.average() * ! (GC::gc()->heap()->tlab_capacity(myThread()) / HeapWordSize)); size_t new_size = alloc / _target_refills; new_size = MIN2(MAX2(new_size, min_size()), max_size()); size_t aligned_new_size = align_object_size(new_size);
*** 194,205 **** set_desired_size(initial_desired_size()); // Following check is needed because at startup the main (primordial) // thread is initialized before the heap is. The initialization for // this thread is redone in startup_initialization below. ! if (Universe::heap() != NULL) { ! size_t capacity = Universe::heap()->tlab_capacity(myThread()) / HeapWordSize; double alloc_frac = desired_size() * target_refills() / (double) capacity; _allocation_fraction.sample(alloc_frac); } set_refill_waste_limit(initial_refill_waste_limit()); --- 194,205 ---- set_desired_size(initial_desired_size()); // Following check is needed because at startup the main (primordial) // thread is initialized before the heap is. The initialization for // this thread is redone in startup_initialization below. ! if (GC::gc()->heap() != NULL) { ! size_t capacity = GC::gc()->heap()->tlab_capacity(myThread()) / HeapWordSize; double alloc_frac = desired_size() * target_refills() / (double) capacity; _allocation_fraction.sample(alloc_frac); } set_refill_waste_limit(initial_refill_waste_limit());
*** 254,264 **** init_sz = TLABSize / HeapWordSize; } else if (global_stats() != NULL) { // Initial size is a function of the average number of allocating threads. unsigned nof_threads = global_stats()->allocating_threads_avg(); ! init_sz = (Universe::heap()->tlab_capacity(myThread()) / HeapWordSize) / (nof_threads * target_refills()); init_sz = align_object_size(init_sz); } init_sz = MIN2(MAX2(init_sz, min_size()), max_size()); return init_sz; --- 254,264 ---- init_sz = TLABSize / HeapWordSize; } else if (global_stats() != NULL) { // Initial size is a function of the average number of allocating threads. unsigned nof_threads = global_stats()->allocating_threads_avg(); ! init_sz = (GC::gc()->heap()->tlab_capacity(myThread()) / HeapWordSize) / (nof_threads * target_refills()); init_sz = align_object_size(init_sz); } init_sz = MIN2(MAX2(init_sz, min_size()), max_size()); return init_sz;
*** 273,283 **** Thread* thrd = myThread(); size_t waste = _gc_waste + _slow_refill_waste + _fast_refill_waste; size_t alloc = _number_of_refills * _desired_size; double waste_percent = alloc == 0 ? 0.0 : 100.0 * waste / alloc; ! size_t tlab_used = Universe::heap()->tlab_used(thrd); log.trace("TLAB: %s thread: " INTPTR_FORMAT " [id: %2d]" " desired_size: " SIZE_FORMAT "KB" " slow allocs: %d refill waste: " SIZE_FORMAT "B" " alloc:%8.5f %8.0fKB refills: %d waste %4.1f%% gc: %dB" " slow: %dB fast: %dB", --- 273,283 ---- Thread* thrd = myThread(); size_t waste = _gc_waste + _slow_refill_waste + _fast_refill_waste; size_t alloc = _number_of_refills * _desired_size; double waste_percent = alloc == 0 ? 0.0 : 100.0 * waste / alloc; ! size_t tlab_used = GC::gc()->heap()->tlab_used(thrd); log.trace("TLAB: %s thread: " INTPTR_FORMAT " [id: %2d]" " desired_size: " SIZE_FORMAT "KB" " slow allocs: %d refill waste: " SIZE_FORMAT "B" " alloc:%8.5f %8.0fKB refills: %d waste %4.1f%% gc: %dB" " slow: %dB fast: %dB",
< prev index next >