comparison src/share/vm/runtime/aprofiler.hpp @ 6725:da91efe96a93

6964458: Reimplement class meta-data storage to use native memory Summary: Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland Contributed-by: jmasa <jon.masamitsu@oracle.com>, stefank <stefan.karlsson@oracle.com>, mgerdin <mikael.gerdin@oracle.com>, never <tom.rodriguez@oracle.com>
author coleenp
date Sat, 01 Sep 2012 13:25:18 -0400
parents f95d63e2154a
children
comparison
equal deleted inserted replaced
6724:36d1d483d5d6 6725:da91efe96a93
1 /* 1 /*
2 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 1997, 2012, 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.
26 #define SHARE_VM_RUNTIME_APROFILER_HPP 26 #define SHARE_VM_RUNTIME_APROFILER_HPP
27 27
28 #include "memory/allocation.hpp" 28 #include "memory/allocation.hpp"
29 #include "memory/universe.hpp" 29 #include "memory/universe.hpp"
30 #include "oops/klass.hpp" 30 #include "oops/klass.hpp"
31 #include "oops/klassOop.hpp"
32 #include "utilities/top.hpp" 31 #include "utilities/top.hpp"
33 32
34 // A simple allocation profiler for Java. The profiler collects and prints 33 // A simple allocation profiler for Java. The profiler collects and prints
35 // the number and total size of instances allocated per class, including 34 // the number and total size of instances allocated per class, including
36 // array classes. 35 // array classes.
44 friend class GenCollectedHeap; 43 friend class GenCollectedHeap;
45 friend class G1CollectedHeap; 44 friend class G1CollectedHeap;
46 friend class MarkSweep; 45 friend class MarkSweep;
47 private: 46 private:
48 static bool _active; // tells whether profiler is active 47 static bool _active; // tells whether profiler is active
49 static GrowableArray<klassOop>* _print_array; // temporary array for printing 48 static GrowableArray<Klass*>* _print_array; // temporary array for printing
50 49
51 // Utility printing functions 50 // Utility printing functions
52 static void add_class_to_array(klassOop k); 51 static void add_class_to_array(Klass* k);
53 static void add_classes_to_array(klassOop k); 52 static void add_classes_to_array(Klass* k);
54 static int compare_classes(klassOop* k1, klassOop* k2); 53 static int compare_classes(Klass** k1, Klass** k2);
55 static int average(size_t alloc_size, int alloc_count); 54 static int average(size_t alloc_size, int alloc_count);
56 static void sort_and_print_array(size_t cutoff); 55 static void sort_and_print_array(size_t cutoff);
57 56
58 // Call for collecting allocation information. Called at scavenge, mark-sweep and disengage. 57 // Call for collecting allocation information. Called at scavenge, mark-sweep and disengage.
59 static void iterate_since_last_gc(); 58 static void iterate_since_last_gc();