< prev index next >

src/hotspot/share/memory/metaspace/runningCounters.hpp

Print this page

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.
23  *
24  */
25 
26 #ifndef SHARE_MEMORY_METASPACE_RUNNINGCOUNTERS_HPP
27 #define SHARE_MEMORY_METASPACE_RUNNINGCOUNTERS_HPP
28 
29 #include "memory/allStatic.hpp"
30 #include "memory/metaspace/counters.hpp"
31 
32 namespace metaspace {
33 
34 // This class is a convenience interface for accessing global metaspace counters.
35 class RunningCounters : public AllStatic {
36 
37   static SizeAtomicCounter _used_class_counter;
38   static SizeAtomicCounter _used_nonclass_counter;
39 
40 public:
41 
42   // ---- virtual memory -----
43 
44   // Return reserved size, in words, for Metaspace
45   static size_t reserved_words();
46   static size_t reserved_words_class();
47   static size_t reserved_words_nonclass();
48 
49   // Return total committed size, in words, for Metaspace
50   static size_t committed_words();
51   static size_t committed_words_class();
52   static size_t committed_words_nonclass();
53 
54   // ---- used chunks -----
55 
56   // Returns size, in words, used for metadata.
57   static size_t used_words();
58   static size_t used_words_class();
59   static size_t used_words_nonclass();
60 
61   // ---- free chunks -----
62 
63   // Returns size, in words, of all chunks in all freelists.
64   static size_t free_chunks_words();
65   static size_t free_chunks_words_class();
66   static size_t free_chunks_words_nonclass();
67 
68   // Direct access to the counters.
69   static SizeAtomicCounter* used_nonclass_counter()     { return &_used_nonclass_counter; }
70   static SizeAtomicCounter* used_class_counter()        { return &_used_class_counter; }
71 
72 };
73 
74 } // namespace metaspace
75 
76 #endif // SHARE_MEMORY_METASPACE_RUNNINGCOUNTERS_HPP

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.
23  *
24  */
25 
26 #ifndef SHARE_MEMORY_METASPACE_RUNNINGCOUNTERS_HPP
27 #define SHARE_MEMORY_METASPACE_RUNNINGCOUNTERS_HPP
28 
29 #include "memory/allStatic.hpp"

30 
31 namespace metaspace {
32 
33 // This class is a convenience interface for accessing global metaspace counters.
34 struct RunningCounters : public AllStatic {





35 
36   // ---- virtual memory -----
37 
38   // Return reserved size, in words, for Metaspace
39   static size_t reserved_words();
40   static size_t reserved_words_class();
41   static size_t reserved_words_nonclass();
42 
43   // Return total committed size, in words, for Metaspace
44   static size_t committed_words();
45   static size_t committed_words_class();
46   static size_t committed_words_nonclass();
47 
48   // ---- used chunks -----
49 
50   // Returns size, in words, used for metadata.
51   static size_t used_words();
52   static size_t used_words_class();
53   static size_t used_words_nonclass();
54 
55   // ---- free chunks -----
56 
57   // Returns size, in words, of all chunks in all freelists.
58   static size_t free_chunks_words();
59   static size_t free_chunks_words_class();
60   static size_t free_chunks_words_nonclass();
61 




62 };
63 
64 } // namespace metaspace
65 
66 #endif // SHARE_MEMORY_METASPACE_RUNNINGCOUNTERS_HPP
< prev index next >