src/hotspot/share/gc/shared/threadLocalAllocBuffer.cpp
changeset 47679 4cfcb7be4984
parent 47216 71c04702a3d5
child 48005 9fd89aabb6cd
equal deleted inserted replaced
47678:c84eeb55c55e 47679:4cfcb7be4984
     1 /*
     1 /*
     2  * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
   273   }
   273   }
   274 
   274 
   275   Thread* thrd = myThread();
   275   Thread* thrd = myThread();
   276   size_t waste = _gc_waste + _slow_refill_waste + _fast_refill_waste;
   276   size_t waste = _gc_waste + _slow_refill_waste + _fast_refill_waste;
   277   size_t alloc = _number_of_refills * _desired_size;
   277   size_t alloc = _number_of_refills * _desired_size;
   278   double waste_percent = alloc == 0 ? 0.0 :
   278   double waste_percent = percent_of(waste, alloc);
   279                       100.0 * waste / alloc;
       
   280   size_t tlab_used  = Universe::heap()->tlab_used(thrd);
   279   size_t tlab_used  = Universe::heap()->tlab_used(thrd);
   281   log.trace("TLAB: %s thread: " INTPTR_FORMAT " [id: %2d]"
   280   log.trace("TLAB: %s thread: " INTPTR_FORMAT " [id: %2d]"
   282             " desired_size: " SIZE_FORMAT "KB"
   281             " desired_size: " SIZE_FORMAT "KB"
   283             " slow allocs: %d  refill waste: " SIZE_FORMAT "B"
   282             " slow allocs: %d  refill waste: " SIZE_FORMAT "B"
   284             " alloc:%8.5f %8.0fKB refills: %d waste %4.1f%% gc: %dB"
   283             " alloc:%8.5f %8.0fKB refills: %d waste %4.1f%% gc: %dB"
   414   if (!log.is_debug()) {
   413   if (!log.is_debug()) {
   415     return;
   414     return;
   416   }
   415   }
   417 
   416 
   418   size_t waste = _total_gc_waste + _total_slow_refill_waste + _total_fast_refill_waste;
   417   size_t waste = _total_gc_waste + _total_slow_refill_waste + _total_fast_refill_waste;
   419   double waste_percent = _total_allocation == 0 ? 0.0 :
   418   double waste_percent = percent_of(waste, _total_allocation);
   420                          100.0 * waste / _total_allocation;
       
   421   log.debug("TLAB totals: thrds: %d  refills: %d max: %d"
   419   log.debug("TLAB totals: thrds: %d  refills: %d max: %d"
   422             " slow allocs: %d max %d waste: %4.1f%%"
   420             " slow allocs: %d max %d waste: %4.1f%%"
   423             " gc: " SIZE_FORMAT "B max: " SIZE_FORMAT "B"
   421             " gc: " SIZE_FORMAT "B max: " SIZE_FORMAT "B"
   424             " slow: " SIZE_FORMAT "B max: " SIZE_FORMAT "B"
   422             " slow: " SIZE_FORMAT "B max: " SIZE_FORMAT "B"
   425             " fast: " SIZE_FORMAT "B max: " SIZE_FORMAT "B",
   423             " fast: " SIZE_FORMAT "B max: " SIZE_FORMAT "B",