< prev index next >

src/hotspot/share/memory/metaspace.hpp

Print this page
rev 50187 : imported patch metaspace-split

*** 53,79 **** // | | // | | // +-------------------+ // - class ChunkManager; class ClassLoaderData; - class Metablock; - class Metachunk; class MetaspaceTracer; class MetaWord; class Mutex; class outputStream; ! class PrintCLDMetaspaceInfoClosure; ! class SpaceManager; ! class VirtualSpaceList; class CollectedHeap; namespace metaspace { ! namespace internals { class ClassLoaderMetaspaceStatistics; ! }} // Metaspaces each have a SpaceManager and allocations // are done by the SpaceManager. Allocations are done // out of the current Metachunk. When the current Metachunk // is exhausted, the SpaceManager gets a new one from --- 53,79 ---- // | | // | | // +-------------------+ // class ClassLoaderData; class MetaspaceTracer; class MetaWord; class Mutex; class outputStream; ! class CollectedHeap; namespace metaspace { ! class ChunkManager; class ClassLoaderMetaspaceStatistics; ! class Metablock; ! class Metachunk; ! class PrintCLDMetaspaceInfoClosure; ! class SpaceManager; ! class VirtualSpaceList; ! } // Metaspaces each have a SpaceManager and allocations // are done by the SpaceManager. Allocations are done // out of the current Metachunk. When the current Metachunk // is exhausted, the SpaceManager gets a new one from
*** 129,163 **** static size_t _commit_alignment; static size_t _reserve_alignment; DEBUG_ONLY(static bool _frozen;) // Virtual Space lists for both classes and other metadata ! static VirtualSpaceList* _space_list; ! static VirtualSpaceList* _class_space_list; ! static ChunkManager* _chunk_manager_metadata; ! static ChunkManager* _chunk_manager_class; static const MetaspaceTracer* _tracer; public: ! static VirtualSpaceList* space_list() { return _space_list; } ! static VirtualSpaceList* class_space_list() { return _class_space_list; } ! static VirtualSpaceList* get_space_list(MetadataType mdtype) { assert(mdtype != MetadataTypeCount, "MetadaTypeCount can't be used as mdtype"); return mdtype == ClassType ? class_space_list() : space_list(); } ! static ChunkManager* chunk_manager_metadata() { return _chunk_manager_metadata; } ! static ChunkManager* chunk_manager_class() { return _chunk_manager_class; } ! static ChunkManager* get_chunk_manager(MetadataType mdtype) { assert(mdtype != MetadataTypeCount, "MetadaTypeCount can't be used as mdtype"); return mdtype == ClassType ? chunk_manager_class() : chunk_manager_metadata(); } // convenience function ! static ChunkManager* get_chunk_manager(bool is_class) { return is_class ? chunk_manager_class() : chunk_manager_metadata(); } static const MetaspaceTracer* tracer() { return _tracer; } static void freeze() { --- 129,163 ---- static size_t _commit_alignment; static size_t _reserve_alignment; DEBUG_ONLY(static bool _frozen;) // Virtual Space lists for both classes and other metadata ! static metaspace::VirtualSpaceList* _space_list; ! static metaspace::VirtualSpaceList* _class_space_list; ! static metaspace::ChunkManager* _chunk_manager_metadata; ! static metaspace::ChunkManager* _chunk_manager_class; static const MetaspaceTracer* _tracer; public: ! static metaspace::VirtualSpaceList* space_list() { return _space_list; } ! static metaspace::VirtualSpaceList* class_space_list() { return _class_space_list; } ! static metaspace::VirtualSpaceList* get_space_list(MetadataType mdtype) { assert(mdtype != MetadataTypeCount, "MetadaTypeCount can't be used as mdtype"); return mdtype == ClassType ? class_space_list() : space_list(); } ! static metaspace::ChunkManager* chunk_manager_metadata() { return _chunk_manager_metadata; } ! static metaspace::ChunkManager* chunk_manager_class() { return _chunk_manager_class; } ! static metaspace::ChunkManager* get_chunk_manager(MetadataType mdtype) { assert(mdtype != MetadataTypeCount, "MetadaTypeCount can't be used as mdtype"); return mdtype == ClassType ? chunk_manager_class() : chunk_manager_metadata(); } // convenience function ! static metaspace::ChunkManager* get_chunk_manager(bool is_class) { return is_class ? chunk_manager_class() : chunk_manager_metadata(); } static const MetaspaceTracer* tracer() { return _tracer; } static void freeze() {
*** 229,259 **** // Manages the metaspace portion belonging to a class loader class ClassLoaderMetaspace : public CHeapObj<mtClass> { friend class CollectedHeap; // For expand_and_allocate() friend class Metaspace; friend class MetaspaceUtils; ! friend class PrintCLDMetaspaceInfoClosure; friend class VM_CollectForMetadataAllocation; // For expand_and_allocate() private: void initialize(Mutex* lock, Metaspace::MetaspaceType type); // Initialize the first chunk for a Metaspace. Used for // special cases such as the boot class loader, reflection // class loader and anonymous class loader. void initialize_first_chunk(Metaspace::MetaspaceType type, Metaspace::MetadataType mdtype); ! Metachunk* get_initialization_chunk(Metaspace::MetaspaceType type, Metaspace::MetadataType mdtype); const Metaspace::MetaspaceType _space_type; Mutex* const _lock; ! SpaceManager* _vsm; ! SpaceManager* _class_vsm; ! SpaceManager* vsm() const { return _vsm; } ! SpaceManager* class_vsm() const { return _class_vsm; } ! SpaceManager* get_space_manager(Metaspace::MetadataType mdtype) { assert(mdtype != Metaspace::MetadataTypeCount, "MetadaTypeCount can't be used as mdtype"); return mdtype == Metaspace::ClassType ? class_vsm() : vsm(); } Mutex* lock() const { return _lock; } --- 229,259 ---- // Manages the metaspace portion belonging to a class loader class ClassLoaderMetaspace : public CHeapObj<mtClass> { friend class CollectedHeap; // For expand_and_allocate() friend class Metaspace; friend class MetaspaceUtils; ! friend class metaspace::PrintCLDMetaspaceInfoClosure; friend class VM_CollectForMetadataAllocation; // For expand_and_allocate() private: void initialize(Mutex* lock, Metaspace::MetaspaceType type); // Initialize the first chunk for a Metaspace. Used for // special cases such as the boot class loader, reflection // class loader and anonymous class loader. void initialize_first_chunk(Metaspace::MetaspaceType type, Metaspace::MetadataType mdtype); ! metaspace::Metachunk* get_initialization_chunk(Metaspace::MetaspaceType type, Metaspace::MetadataType mdtype); const Metaspace::MetaspaceType _space_type; Mutex* const _lock; ! metaspace::SpaceManager* _vsm; ! metaspace::SpaceManager* _class_vsm; ! metaspace::SpaceManager* vsm() const { return _vsm; } ! metaspace::SpaceManager* class_vsm() const { return _class_vsm; } ! metaspace::SpaceManager* get_space_manager(Metaspace::MetadataType mdtype) { assert(mdtype != Metaspace::MetadataTypeCount, "MetadaTypeCount can't be used as mdtype"); return mdtype == Metaspace::ClassType ? class_vsm() : vsm(); } Mutex* lock() const { return _lock; }
*** 261,279 **** MetaWord* expand_and_allocate(size_t size, Metaspace::MetadataType mdtype); size_t class_chunk_size(size_t word_size); // Adds to the given statistic object. Must be locked with CLD metaspace lock. ! void add_to_statistics_locked(metaspace::internals::ClassLoaderMetaspaceStatistics* out) const; public: ClassLoaderMetaspace(Mutex* lock, Metaspace::MetaspaceType type); ~ClassLoaderMetaspace(); - Metaspace::MetaspaceType space_type() const { return _space_type; } - // Allocate space for metadata of type mdtype. This is space // within a Metachunk and is used by // allocate(ClassLoaderData*, size_t, bool, MetadataType, TRAPS) MetaWord* allocate(size_t word_size, Metaspace::MetadataType mdtype); --- 261,279 ---- MetaWord* expand_and_allocate(size_t size, Metaspace::MetadataType mdtype); size_t class_chunk_size(size_t word_size); // Adds to the given statistic object. Must be locked with CLD metaspace lock. ! void add_to_statistics_locked(metaspace::ClassLoaderMetaspaceStatistics* out) const; ! ! Metaspace::MetaspaceType space_type() const { return _space_type; } public: ClassLoaderMetaspace(Mutex* lock, Metaspace::MetaspaceType type); ~ClassLoaderMetaspace(); // Allocate space for metadata of type mdtype. This is space // within a Metachunk and is used by // allocate(ClassLoaderData*, size_t, bool, MetadataType, TRAPS) MetaWord* allocate(size_t word_size, Metaspace::MetadataType mdtype);
*** 285,302 **** void print_on(outputStream* st) const; // Debugging support void verify(); // Adds to the given statistic object. Will lock with CLD metaspace lock. ! void add_to_statistics(metaspace::internals::ClassLoaderMetaspaceStatistics* out) const; }; // ClassLoaderMetaspace class MetaspaceUtils : AllStatic { // Spacemanager updates running counters. ! friend class SpaceManager; // Running counters for statistics concerning in-use chunks. // Note: capacity = used + free + waste + overhead. Note that we do not // count free and waste. Their sum can be deduces from the three other values. // For more details, one should call print_report() from within a safe point. --- 285,302 ---- void print_on(outputStream* st) const; // Debugging support void verify(); // Adds to the given statistic object. Will lock with CLD metaspace lock. ! void add_to_statistics(metaspace::ClassLoaderMetaspaceStatistics* out) const; }; // ClassLoaderMetaspace class MetaspaceUtils : AllStatic { // Spacemanager updates running counters. ! friend class metaspace::SpaceManager; // Running counters for statistics concerning in-use chunks. // Note: capacity = used + free + waste + overhead. Note that we do not // count free and waste. Their sum can be deduces from the three other values. // For more details, one should call print_report() from within a safe point.
*** 326,336 **** public: // Collect used metaspace statistics. This involves walking the CLDG. The resulting // output will be the accumulated values for all live metaspaces. // Note: method does not do any locking. ! static void collect_statistics(metaspace::internals::ClassLoaderMetaspaceStatistics* out); // Used by MetaspaceCounters static size_t free_chunks_total_words(); static size_t free_chunks_total_bytes(); static size_t free_chunks_total_bytes(Metaspace::MetadataType mdtype); --- 326,336 ---- public: // Collect used metaspace statistics. This involves walking the CLDG. The resulting // output will be the accumulated values for all live metaspaces. // Note: method does not do any locking. ! static void collect_statistics(metaspace::ClassLoaderMetaspaceStatistics* out); // Used by MetaspaceCounters static size_t free_chunks_total_words(); static size_t free_chunks_total_bytes(); static size_t free_chunks_total_bytes(Metaspace::MetadataType mdtype);
< prev index next >