equal
deleted
inserted
replaced
26 |
26 |
27 #include "memory/allocation.hpp" |
27 #include "memory/allocation.hpp" |
28 #include "memory/memRegion.hpp" |
28 #include "memory/memRegion.hpp" |
29 #include "memory/metaspaceChunkFreeListSummary.hpp" |
29 #include "memory/metaspaceChunkFreeListSummary.hpp" |
30 #include "memory/virtualspace.hpp" |
30 #include "memory/virtualspace.hpp" |
|
31 #include "memory/metaspace/metaspaceSizesSnapshot.hpp" |
|
32 #include "runtime/globals.hpp" |
31 #include "utilities/exceptions.hpp" |
33 #include "utilities/exceptions.hpp" |
32 |
34 |
33 // Metaspace |
35 // Metaspace |
34 // |
36 // |
35 // Metaspaces are Arenas for the VM's metadata. |
37 // Metaspaces are Arenas for the VM's metadata. |
137 static metaspace::ChunkManager* _chunk_manager_metadata; |
139 static metaspace::ChunkManager* _chunk_manager_metadata; |
138 static metaspace::ChunkManager* _chunk_manager_class; |
140 static metaspace::ChunkManager* _chunk_manager_class; |
139 |
141 |
140 static const MetaspaceTracer* _tracer; |
142 static const MetaspaceTracer* _tracer; |
141 |
143 |
|
144 static bool _initialized; |
|
145 |
142 public: |
146 public: |
143 static metaspace::VirtualSpaceList* space_list() { return _space_list; } |
147 static metaspace::VirtualSpaceList* space_list() { return _space_list; } |
144 static metaspace::VirtualSpaceList* class_space_list() { return _class_space_list; } |
148 static metaspace::VirtualSpaceList* class_space_list() { return _class_space_list; } |
145 static metaspace::VirtualSpaceList* get_space_list(MetadataType mdtype) { |
149 static metaspace::VirtualSpaceList* get_space_list(MetadataType mdtype) { |
146 assert(mdtype != MetadataTypeCount, "MetadaTypeCount can't be used as mdtype"); |
150 assert(mdtype != MetadataTypeCount, "MetadaTypeCount can't be used as mdtype"); |
221 } |
225 } |
222 |
226 |
223 static bool is_class_space_allocation(MetadataType mdType) { |
227 static bool is_class_space_allocation(MetadataType mdType) { |
224 return mdType == ClassType && using_class_space(); |
228 return mdType == ClassType && using_class_space(); |
225 } |
229 } |
|
230 |
|
231 static bool initialized() { return _initialized; } |
226 |
232 |
227 }; |
233 }; |
228 |
234 |
229 // Manages the metaspace portion belonging to a class loader |
235 // Manages the metaspace portion belonging to a class loader |
230 class ClassLoaderMetaspace : public CHeapObj<mtClass> { |
236 class ClassLoaderMetaspace : public CHeapObj<mtClass> { |
408 static void print_report(outputStream* out, size_t scale = 0, int flags = 0); |
414 static void print_report(outputStream* out, size_t scale = 0, int flags = 0); |
409 |
415 |
410 static bool has_chunk_free_list(Metaspace::MetadataType mdtype); |
416 static bool has_chunk_free_list(Metaspace::MetadataType mdtype); |
411 static MetaspaceChunkFreeListSummary chunk_free_list_summary(Metaspace::MetadataType mdtype); |
417 static MetaspaceChunkFreeListSummary chunk_free_list_summary(Metaspace::MetadataType mdtype); |
412 |
418 |
413 // Print change in used metadata. |
419 // Log change in used metadata. |
414 static void print_metaspace_change(size_t prev_metadata_used); |
420 static void print_metaspace_change(const metaspace::MetaspaceSizesSnapshot& pre_meta_values); |
415 static void print_on(outputStream * out); |
421 static void print_on(outputStream * out); |
416 |
422 |
417 // Prints an ASCII representation of the given space. |
423 // Prints an ASCII representation of the given space. |
418 static void print_metaspace_map(outputStream* out, Metaspace::MetadataType mdtype); |
424 static void print_metaspace_map(outputStream* out, Metaspace::MetadataType mdtype); |
419 |
425 |