src/share/vm/memory/threadLocalAllocBuffer.cpp

changeset 7470
060cdf93040c
parent 6680
78bbf4d43a14
child 7535
7ae4e26cb1e0
child 9289
427b2fb1944f
     1.1 --- a/src/share/vm/memory/threadLocalAllocBuffer.cpp	Fri Sep 26 17:48:10 2014 -0400
     1.2 +++ b/src/share/vm/memory/threadLocalAllocBuffer.cpp	Thu Oct 09 15:42:23 2014 +0200
     1.3 @@ -235,22 +235,19 @@
     1.4  }
     1.5  
     1.6  size_t ThreadLocalAllocBuffer::initial_desired_size() {
     1.7 -  size_t init_sz;
     1.8 +  size_t init_sz = 0;
     1.9  
    1.10    if (TLABSize > 0) {
    1.11 -    init_sz = MIN2(TLABSize / HeapWordSize, max_size());
    1.12 -  } else if (global_stats() == NULL) {
    1.13 -    // Startup issue - main thread initialized before heap initialized.
    1.14 -    init_sz = min_size();
    1.15 -  } else {
    1.16 +    init_sz = TLABSize / HeapWordSize;
    1.17 +  } else if (global_stats() != NULL) {
    1.18      // Initial size is a function of the average number of allocating threads.
    1.19      unsigned nof_threads = global_stats()->allocating_threads_avg();
    1.20  
    1.21      init_sz  = (Universe::heap()->tlab_capacity(myThread()) / HeapWordSize) /
    1.22                        (nof_threads * target_refills());
    1.23      init_sz = align_object_size(init_sz);
    1.24 -    init_sz = MIN2(MAX2(init_sz, min_size()), max_size());
    1.25    }
    1.26 +  init_sz = MIN2(MAX2(init_sz, min_size()), max_size());
    1.27    return init_sz;
    1.28  }
    1.29  

mercurial