src/share/vm/memory/metaspace.hpp

Print this page
rev 4210 : 8000754: NPG: Implement a MemoryPool MXBean for Metaspace


 140 
 141   static Metablock* allocate(ClassLoaderData* loader_data, size_t size,
 142                             bool read_only, MetadataType mdtype, TRAPS);
 143   void deallocate(MetaWord* ptr, size_t byte_size, bool is_class);
 144 
 145   MetaWord* expand_and_allocate(size_t size,
 146                                 MetadataType mdtype);
 147 
 148   static bool is_initialized() { return _class_space_list != NULL; }
 149 
 150   static bool contains(const void *ptr);
 151   void dump(outputStream* const out) const;
 152 
 153   void print_on(outputStream* st) const;
 154   // Debugging support
 155   void verify();
 156 };
 157 
 158 class MetaspaceAux : AllStatic {
 159 




 160   // Statistics for class space and data space in metaspace.
 161   static size_t used_in_bytes(Metaspace::MetadataType mdtype);
 162   static size_t free_in_bytes(Metaspace::MetadataType mdtype);
 163   static size_t capacity_in_bytes(Metaspace::MetadataType mdtype);
 164   static size_t reserved_in_bytes(Metaspace::MetadataType mdtype);
 165 
 166   static size_t free_chunks_total(Metaspace::MetadataType mdtype);
 167   static size_t free_chunks_total_in_bytes(Metaspace::MetadataType mdtype);
 168 
 169  public:
 170   // Total of space allocated to metadata in all Metaspaces
 171   static size_t used_in_bytes() {
 172     return used_in_bytes(Metaspace::ClassType) +
 173            used_in_bytes(Metaspace::NonClassType);
 174   }
 175 
 176   // Total of available space in all Metaspaces
 177   // Total of capacity allocated to all Metaspaces.  This includes
 178   // space in Metachunks not yet allocated and in the Metachunk
 179   // freelist.
 180   static size_t capacity_in_bytes() {
 181     return capacity_in_bytes(Metaspace::ClassType) +
 182            capacity_in_bytes(Metaspace::NonClassType);
 183   }
 184 
 185   // Total space reserved in all Metaspaces
 186   static size_t reserved_in_bytes() {
 187     return reserved_in_bytes(Metaspace::ClassType) +
 188            reserved_in_bytes(Metaspace::NonClassType);
 189   }




 140 
 141   static Metablock* allocate(ClassLoaderData* loader_data, size_t size,
 142                             bool read_only, MetadataType mdtype, TRAPS);
 143   void deallocate(MetaWord* ptr, size_t byte_size, bool is_class);
 144 
 145   MetaWord* expand_and_allocate(size_t size,
 146                                 MetadataType mdtype);
 147 
 148   static bool is_initialized() { return _class_space_list != NULL; }
 149 
 150   static bool contains(const void *ptr);
 151   void dump(outputStream* const out) const;
 152 
 153   void print_on(outputStream* st) const;
 154   // Debugging support
 155   void verify();
 156 };
 157 
 158 class MetaspaceAux : AllStatic {
 159 
 160   static size_t free_chunks_total(Metaspace::MetadataType mdtype);
 161   static size_t free_chunks_total_in_bytes(Metaspace::MetadataType mdtype);
 162 
 163  public:
 164   // Statistics for class space and data space in metaspace.
 165   static size_t used_in_bytes(Metaspace::MetadataType mdtype);
 166   static size_t free_in_bytes(Metaspace::MetadataType mdtype);
 167   static size_t capacity_in_bytes(Metaspace::MetadataType mdtype);
 168   static size_t reserved_in_bytes(Metaspace::MetadataType mdtype);
 169 




 170   // Total of space allocated to metadata in all Metaspaces
 171   static size_t used_in_bytes() {
 172     return used_in_bytes(Metaspace::ClassType) +
 173            used_in_bytes(Metaspace::NonClassType);
 174   }
 175 
 176   // Total of available space in all Metaspaces
 177   // Total of capacity allocated to all Metaspaces.  This includes
 178   // space in Metachunks not yet allocated and in the Metachunk
 179   // freelist.
 180   static size_t capacity_in_bytes() {
 181     return capacity_in_bytes(Metaspace::ClassType) +
 182            capacity_in_bytes(Metaspace::NonClassType);
 183   }
 184 
 185   // Total space reserved in all Metaspaces
 186   static size_t reserved_in_bytes() {
 187     return reserved_in_bytes(Metaspace::ClassType) +
 188            reserved_in_bytes(Metaspace::NonClassType);
 189   }