1 /*
2 * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
3 * Copyright (c) 2018 SAP SE. All rights reserved.
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 *
6 * This code is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 only, as
8 * published by the Free Software Foundation.
9 *
10 * This code is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * version 2 for more details (a copy is included in the LICENSE file that
14 * accompanied this code).
15 *
16 * You should have received a copy of the GNU General Public License version
17 * 2 along with this work; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19 *
20 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21 * or visit www.oracle.com if you need additional information or have any
22 * questions.
1959 if (!initialization_complete) {
1960 return;
1961 }
1962
1963 const char* heapName = get_heapName(heap);
1964 get_HeapStatGlobals(out, heapName);
1965
1966 if ((StatArray == NULL) || (alloc_granules == 0)) {
1967 return;
1968 }
1969 STRINGSTREAM_DECL(ast, out)
1970
1971 unsigned int granules_per_line = 32;
1972 char* low_bound = heap->low_boundary();
1973
1974 {
1975 printBox(ast, '=', "M E T H O D A G E by CompileID for ", heapName);
1976 ast->print_cr(" The age of a compiled method in the CodeHeap is not available as a\n"
1977 " time stamp. Instead, a relative age is deducted from the method's compilation ID.\n"
1978 " Age information is available for tier1 and tier2 methods only. There is no\n"
1979 " age information for stubs and blobs, because they have no compilation ID assigned.\n"
1980 " Information for the youngest method (highest ID) in the granule is printed.\n"
1981 " Refer to the legend to learn how method age is mapped to the displayed digit.");
1982 print_age_legend(ast);
1983 STRINGSTREAM_FLUSH_LOCKED("")
1984 }
1985
1986 {
1987 printBox(ast, '-', "Age distribution. '0' indicates youngest 1/256, '8': oldest half, ' ': no age information", NULL);
1988 STRINGSTREAM_FLUSH_LOCKED("")
1989
1990 granules_per_line = 128;
1991 for (unsigned int ix = 0; ix < alloc_granules; ix++) {
1992 print_line_delim(out, ast, low_bound, ix, granules_per_line);
1993 unsigned int age1 = StatArray[ix].t1_age;
1994 unsigned int age2 = StatArray[ix].t2_age;
1995 unsigned int agex = StatArray[ix].tx_age;
1996 unsigned int age = age1 > age2 ? age1 : age2;
1997 age = age > agex ? age : agex;
1998 print_age_single(ast, age);
1999 }
|
1 /*
2 * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
3 * Copyright (c) 2018 SAP SE. All rights reserved.
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 *
6 * This code is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 only, as
8 * published by the Free Software Foundation.
9 *
10 * This code is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * version 2 for more details (a copy is included in the LICENSE file that
14 * accompanied this code).
15 *
16 * You should have received a copy of the GNU General Public License version
17 * 2 along with this work; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19 *
20 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21 * or visit www.oracle.com if you need additional information or have any
22 * questions.
1959 if (!initialization_complete) {
1960 return;
1961 }
1962
1963 const char* heapName = get_heapName(heap);
1964 get_HeapStatGlobals(out, heapName);
1965
1966 if ((StatArray == NULL) || (alloc_granules == 0)) {
1967 return;
1968 }
1969 STRINGSTREAM_DECL(ast, out)
1970
1971 unsigned int granules_per_line = 32;
1972 char* low_bound = heap->low_boundary();
1973
1974 {
1975 printBox(ast, '=', "M E T H O D A G E by CompileID for ", heapName);
1976 ast->print_cr(" The age of a compiled method in the CodeHeap is not available as a\n"
1977 " time stamp. Instead, a relative age is deducted from the method's compilation ID.\n"
1978 " Age information is available for tier1 and tier2 methods only. There is no\n"
1979 " age information for stubs and blobs, because they have no compilation ID assigned.\n"
1980 " Information for the youngest method (highest ID) in the granule is printed.\n"
1981 " Refer to the legend to learn how method age is mapped to the displayed digit.");
1982 print_age_legend(ast);
1983 STRINGSTREAM_FLUSH_LOCKED("")
1984 }
1985
1986 {
1987 printBox(ast, '-', "Age distribution. '0' indicates youngest 1/256, '8': oldest half, ' ': no age information", NULL);
1988 STRINGSTREAM_FLUSH_LOCKED("")
1989
1990 granules_per_line = 128;
1991 for (unsigned int ix = 0; ix < alloc_granules; ix++) {
1992 print_line_delim(out, ast, low_bound, ix, granules_per_line);
1993 unsigned int age1 = StatArray[ix].t1_age;
1994 unsigned int age2 = StatArray[ix].t2_age;
1995 unsigned int agex = StatArray[ix].tx_age;
1996 unsigned int age = age1 > age2 ? age1 : age2;
1997 age = age > agex ? age : agex;
1998 print_age_single(ast, age);
1999 }
|