classify.hpp revision 1472
0035018c6da861f1b758fb9bf6b50245c52b48e2Raymond Chen * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
0035018c6da861f1b758fb9bf6b50245c52b48e2Raymond Chen * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0035018c6da861f1b758fb9bf6b50245c52b48e2Raymond Chen * This code is free software; you can redistribute it and/or modify it
0035018c6da861f1b758fb9bf6b50245c52b48e2Raymond Chen * under the terms of the GNU General Public License version 2 only, as
0035018c6da861f1b758fb9bf6b50245c52b48e2Raymond Chen * published by the Free Software Foundation.
0035018c6da861f1b758fb9bf6b50245c52b48e2Raymond Chen * This code is distributed in the hope that it will be useful, but WITHOUT
0035018c6da861f1b758fb9bf6b50245c52b48e2Raymond Chen * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0035018c6da861f1b758fb9bf6b50245c52b48e2Raymond Chen * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0035018c6da861f1b758fb9bf6b50245c52b48e2Raymond Chen * version 2 for more details (a copy is included in the LICENSE file that
0035018c6da861f1b758fb9bf6b50245c52b48e2Raymond Chen * accompanied this code).
0035018c6da861f1b758fb9bf6b50245c52b48e2Raymond Chen * You should have received a copy of the GNU General Public License version
0035018c6da861f1b758fb9bf6b50245c52b48e2Raymond Chen * 2 along with this work; if not, write to the Free Software Foundation,
0035018c6da861f1b758fb9bf6b50245c52b48e2Raymond Chen * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0035018c6da861f1b758fb9bf6b50245c52b48e2Raymond Chen * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
0035018c6da861f1b758fb9bf6b50245c52b48e2Raymond Chen * or visit www.oracle.com if you need additional information or have any
0035018c6da861f1b758fb9bf6b50245c52b48e2Raymond Chen * questions.
0035018c6da861f1b758fb9bf6b50245c52b48e2Raymond Chentypedef enum oop_type {
0035018c6da861f1b758fb9bf6b50245c52b48e2Raymond Chen// Classify objects by type and keep counts.
0035018c6da861f1b758fb9bf6b50245c52b48e2Raymond Chen// Print the count and space taken for each type.
0035018c6da861f1b758fb9bf6b50245c52b48e2Raymond Chenclass ClassifyObjectClosure : public ObjectClosure {
0035018c6da861f1b758fb9bf6b50245c52b48e2Raymond Chen static const char* object_type_name[number_object_types];
0035018c6da861f1b758fb9bf6b50245c52b48e2Raymond Chen static object_type classify_object(oop obj, bool count);
0035018c6da861f1b758fb9bf6b50245c52b48e2Raymond Chen// Count objects using the alloc_count field in the object's klass
0035018c6da861f1b758fb9bf6b50245c52b48e2Raymond Chenclass ClassifyInstanceKlassClosure : public ClassifyObjectClosure {
0035018c6da861f1b758fb9bf6b50245c52b48e2Raymond Chen// Clear the alloc_count fields in all classes so that the count can be
0035018c6da861f1b758fb9bf6b50245c52b48e2Raymond Chen// restarted.