diff src/share/vm/services/memoryPool.hpp @ 8825:dbd5837b342f

8000754: NPG: Implement a MemoryPool MXBean for Metaspace Reviewed-by: jmasa, stefank
author ehelin
date Fri, 22 Mar 2013 16:10:01 +0100
parents db9981fd3124
children 42e370795a39
line wrap: on
line diff
--- a/src/share/vm/services/memoryPool.hpp	Wed Mar 20 12:27:03 2013 -0700
+++ b/src/share/vm/services/memoryPool.hpp	Fri Mar 22 16:10:01 2013 +0100
@@ -28,6 +28,7 @@
 #include "gc_implementation/shared/mutableSpace.hpp"
 #include "memory/defNewGeneration.hpp"
 #include "memory/heap.hpp"
+#include "memory/metaspace.hpp"
 #include "memory/space.hpp"
 #include "services/memoryUsage.hpp"
 #include "utilities/macros.hpp"
@@ -222,4 +223,29 @@
   size_t used_in_bytes()            { return _codeHeap->allocated_capacity(); }
 };
 
+class MetaspacePoolBase : public MemoryPool {
+private:
+  Metaspace::MetadataType _md_type;
+protected:
+  static const size_t _undefined_max_size = (size_t) -1;
+public:
+  MetaspacePoolBase(const char *name, Metaspace::MetadataType md_type, size_t max_size);
+  MemoryUsage get_memory_usage();
+  size_t used_in_bytes();
+};
+
+class ClassMetaspacePool : public MetaspacePoolBase {
+private:
+  size_t calculate_max_size();
+public:
+  ClassMetaspacePool();
+};
+
+class MetaspacePool : public MetaspacePoolBase {
+private:
+  size_t calculate_max_size();
+public:
+  MetaspacePool();
+};
+
 #endif // SHARE_VM_SERVICES_MEMORYPOOL_HPP