< prev index next >

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

Print this page
@@ -25,10 +25,11 @@
  
  #ifndef SHARE_MEMORY_METASPACE_METASPACECONTEXT_HPP
  #define SHARE_MEMORY_METASPACE_METASPACECONTEXT_HPP
  
  #include "memory/allocation.hpp"
+ #include "memory/metaspace/counters.hpp"
  #include "memory/virtualspace.hpp"
  #include "utilities/debug.hpp"
  
  class outputStream;
  

@@ -59,10 +60,11 @@
  class MetaspaceContext : public CHeapObj<mtMetaspace> {
  
    const char* const _name;
    VirtualSpaceList* const _vslist;
    ChunkManager* const _cm;
+   SizeAtomicCounter _used_words_counter;
  
    MetaspaceContext(const char* name, VirtualSpaceList* vslist, ChunkManager* cm) :
      _name(name),
      _vslist(vslist),
      _cm(cm)

@@ -76,12 +78,13 @@
    // Destroys the context: deletes chunkmanager and virtualspacelist.
    // If this is a non-expandable context over an existing space, that space remains
    // untouched, otherwise all memory is unmapped.
    ~MetaspaceContext();
  
-   VirtualSpaceList* vslist() { return _vslist; }
-   ChunkManager* cm() { return _cm; }
+   VirtualSpaceList* vslist()                    { return _vslist; }
+   ChunkManager* cm()                            { return _cm; }
+   SizeAtomicCounter* used_words_counter()       { return &_used_words_counter; }
  
    // Create a new, empty, expandable metaspace context.
    static MetaspaceContext* create_expandable_context(const char* name, CommitLimiter* commit_limiter);
  
    // Create a new, empty, non-expandable metaspace context atop of an externally provided space.

@@ -101,10 +104,13 @@
  
    // Returns pointer to the global class space context, if compressed class space is active,
    // null otherwise.
    static MetaspaceContext* context_class()        { return _class_space_context; }
  
+   size_t used_words() const;
+   size_t committed_words() const;
+   size_t reserved_words() const;
  };
  
  } // end namespace
  
  #endif // SHARE_MEMORY_METASPACE_METASPACECONTEXT_HPP
< prev index next >