Path: blob/master/src/hotspot/share/memory/metaspace/runningCounters.hpp
40957 views
/*1* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.2* Copyright (c) 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_RUNNINGCOUNTERS_HPP26#define SHARE_MEMORY_METASPACE_RUNNINGCOUNTERS_HPP2728#include "memory/allocation.hpp"29#include "memory/metaspace/counters.hpp"3031namespace metaspace {3233// This class is a convenience interface for accessing global metaspace counters.34class RunningCounters : public AllStatic {3536static SizeAtomicCounter _used_class_counter;37static SizeAtomicCounter _used_nonclass_counter;3839public:4041// ---- virtual memory -----4243// Return reserved size, in words, for Metaspace44static size_t reserved_words();45static size_t reserved_words_class();46static size_t reserved_words_nonclass();4748// Return total committed size, in words, for Metaspace49static size_t committed_words();50static size_t committed_words_class();51static size_t committed_words_nonclass();5253// ---- used chunks -----5455// Returns size, in words, used for metadata.56static size_t used_words();57static size_t used_words_class();58static size_t used_words_nonclass();5960// ---- free chunks -----6162// Returns size, in words, of all chunks in all freelists.63static size_t free_chunks_words();64static size_t free_chunks_words_class();65static size_t free_chunks_words_nonclass();6667// Direct access to the counters.68static SizeAtomicCounter* used_nonclass_counter() { return &_used_nonclass_counter; }69static SizeAtomicCounter* used_class_counter() { return &_used_class_counter; }7071};7273} // namespace metaspace7475#endif // SHARE_MEMORY_METASPACE_RUNNINGCOUNTERS_HPP767778