comparison src/share/vm/memory/threadLocalAllocBuffer.cpp @ 20804:7848fc12602b

Merge with jdk8u40-b25
author Gilles Duboscq <gilles.m.duboscq@oracle.com>
date Tue, 07 Apr 2015 14:58:49 +0200
parents 8f2fb6bec986 060cdf93040c
children 2fd31d8e6b58
comparison
equal deleted inserted replaced
20184:84105dcdb05b 20804:7848fc12602b
237 min_size(), Thread::current()->tlab().initial_desired_size(), max_size()); 237 min_size(), Thread::current()->tlab().initial_desired_size(), max_size());
238 } 238 }
239 } 239 }
240 240
241 size_t ThreadLocalAllocBuffer::initial_desired_size() { 241 size_t ThreadLocalAllocBuffer::initial_desired_size() {
242 size_t init_sz; 242 size_t init_sz = 0;
243 243
244 if (TLABSize > 0) { 244 if (TLABSize > 0) {
245 init_sz = MIN2(TLABSize / HeapWordSize, max_size()); 245 init_sz = TLABSize / HeapWordSize;
246 } else if (global_stats() == NULL) { 246 } else if (global_stats() != NULL) {
247 // Startup issue - main thread initialized before heap initialized.
248 init_sz = min_size();
249 } else {
250 // Initial size is a function of the average number of allocating threads. 247 // Initial size is a function of the average number of allocating threads.
251 unsigned nof_threads = global_stats()->allocating_threads_avg(); 248 unsigned nof_threads = global_stats()->allocating_threads_avg();
252 249
253 init_sz = (Universe::heap()->tlab_capacity(myThread()) / HeapWordSize) / 250 init_sz = (Universe::heap()->tlab_capacity(myThread()) / HeapWordSize) /
254 (nof_threads * target_refills()); 251 (nof_threads * target_refills());
255 init_sz = align_object_size(init_sz); 252 init_sz = align_object_size(init_sz);
256 init_sz = MIN2(MAX2(init_sz, min_size()), max_size()); 253 }
257 } 254 init_sz = MIN2(MAX2(init_sz, min_size()), max_size());
258 return init_sz; 255 return init_sz;
259 } 256 }
260 257
261 void ThreadLocalAllocBuffer::print_stats(const char* tag) { 258 void ThreadLocalAllocBuffer::print_stats(const char* tag) {
262 Thread* thrd = myThread(); 259 Thread* thrd = myThread();