1988N/A * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 0N/A * published by the Free Software Foundation. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1472N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 1879N/A// Thread-Local Edens support 0N/A// static member initialization 0N/A // Publish new stats if some allocation occurred. 0N/A // Update allocation history if a reasonable amount of eden was allocated. 0N/A // Average the fraction of eden allocated in a tlab by this 0N/A // thread for use in the next resize operation. 0N/A // _gc_waste is not subtracted because it's included in 0N/A// Fills the current tlab with a dummy filler array to create 0N/A// an illusion of a contiguous Eden and optionally retires the tlab. 0N/A// Waste accounting should be done in caller as appropriate; see, 0N/A// for example, clear_before_allocation(). 0N/A "TLAB must be reset");
0N/A // Compute the next tlab size using expected allocation amount 0N/A // Reset amount of internal fragmentation 0N/A // Following check is needed because at startup the main (primordial) 0N/A // thread is initialized before the heap is. The initialization for 0N/A // this thread is redone in startup_initialization below. 0N/A // Assuming each thread's active tlab is, on average, 0N/A // During jvm startup, the main (primordial) thread is initialized 0N/A // before the heap is initialized. So reinitialize it now. 0N/A // Startup issue - main thread initialized before heap initialized. 0N/A // Initial size is a function of the average number of allocating threads. 0N/A // TLABs can't be bigger than we can fill with a int[Integer.MAX_VALUE]. 0N/A // This restriction could be removed by enabling filling with multiple arrays. 0N/A // If we compute that the reasonable way as 0N/A // header_size + ((sizeof(jint) * max_jint) / HeapWordSize) 0N/A // we'll overflow on the multiply, so we do the divide first. 0N/A // We actually lose a little by dividing first, 0N/A // but that just makes the TLAB somewhat smaller than the biggest array, 0N/A // which is fine, since we'll be able to fill that. 0N/A " alloc:%8.5f %8.0fKB refills: %d waste %4.1f%% gc: %dB" 0N/A " slow: %dB fast: %dB\n",
0N/A // Clear counters summarizing info from all threads 0N/A " slow allocs: %d max %d waste: %4.1f%%"