Path: blob/master/src/hotspot/share/memory/metaspace/metaspaceReporter.hpp
40957 views
/*1* Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved.2* Copyright (c) 2018, 2020 SAP SE. All rights reserved.3* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.4*5* This code is free software; you can redistribute it and/or modify it6* under the terms of the GNU General Public License version 2 only, as7* published by the Free Software Foundation.8*9* This code is distributed in the hope that it will be useful, but WITHOUT10* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or11* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License12* version 2 for more details (a copy is included in the LICENSE file that13* accompanied this code).14*15* You should have received a copy of the GNU General Public License version16* 2 along with this work; if not, write to the Free Software Foundation,17* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.18*19* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA20* or visit www.oracle.com if you need additional information or have any21* questions.22*23*/2425#ifndef SHARE_MEMORY_METASPACE_METASPACEREPORTER_HPP26#define SHARE_MEMORY_METASPACE_METASPACEREPORTER_HPP2728#include "memory/allocation.hpp"2930namespace metaspace {3132class MetaspaceReporter : public AllStatic {33public:3435// Flags for print_report().36enum class Option {37// Show usage by class loader.38ShowLoaders = (1 << 0),39// Breaks report down by chunk type (small, medium, ...).40BreakDownByChunkType = (1 << 1),41// Breaks report down by space type (anonymous, reflection, ...).42BreakDownBySpaceType = (1 << 2),43// Print details about the underlying virtual spaces.44ShowVSList = (1 << 3),45// If show_loaders: show loaded classes for each loader.46ShowClasses = (1 << 4)47};4849// This will print out a basic metaspace usage report but50// unlike print_report() is guaranteed not to lock or to walk the CLDG.51static void print_basic_report(outputStream* st, size_t scale);5253// Prints a report about the current metaspace state.54// Optional parts can be enabled via flags.55// Function will walk the CLDG and will lock the expand lock; if that is not56// convenient, use print_basic_report() instead.57static void print_report(outputStream* out, size_t scale = 0, int flags = 0);5859};6061} // namespace metaspace6263#endif // SHARE_MEMORY_METASPACE_METASPACEREPORTER_HPP646566