src/share/vm/memory/metaspace.hpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hsx-gc Cdiff src/share/vm/memory/metaspace.hpp

src/share/vm/memory/metaspace.hpp

Print this page

        

*** 85,97 **** friend class VM_CollectForMetadataAllocation; friend class MetaspaceGC; friend class MetaspaceAux; public: ! enum MetadataType {ClassType = 0, ! NonClassType = ClassType + 1, ! MetadataTypeCount = ClassType + 2 }; enum MetaspaceType { StandardMetaspaceType, BootMetaspaceType, ROMetaspaceType, --- 85,98 ---- friend class VM_CollectForMetadataAllocation; friend class MetaspaceGC; friend class MetaspaceAux; public: ! enum MetadataType { ! ClassType, ! NonClassType, ! MetadataTypeCount }; enum MetaspaceType { StandardMetaspaceType, BootMetaspaceType, ROMetaspaceType,
*** 101,110 **** --- 102,114 ---- }; private: void initialize(Mutex* lock, MetaspaceType type); + // Get the first chunk for a Metaspace. Used for + // special cases such as the boot class loader, reflection + // class loader and anonymous class loader. Metachunk* get_initialization_chunk(MetadataType mdtype, size_t chunk_word_size, size_t chunk_bunch); // Align up the word size to the allocation word size
*** 121,130 **** --- 125,137 ---- } static size_t _first_chunk_word_size; static size_t _first_class_chunk_word_size; + static size_t _commit_alignment; + static size_t _reserve_alignment; + SpaceManager* _vsm; SpaceManager* vsm() const { return _vsm; } SpaceManager* _class_vsm; SpaceManager* class_vsm() const { return _class_vsm; }
*** 189,204 **** public: Metaspace(Mutex* lock, MetaspaceType type); ~Metaspace(); ! // Initialize globals for Metaspace static void global_initialize(); static size_t first_chunk_word_size() { return _first_chunk_word_size; } static size_t first_class_chunk_word_size() { return _first_class_chunk_word_size; } char* bottom() const; size_t used_words_slow(MetadataType mdtype) const; size_t free_words_slow(MetadataType mdtype) const; size_t capacity_words_slow(MetadataType mdtype) const; --- 196,216 ---- public: Metaspace(Mutex* lock, MetaspaceType type); ~Metaspace(); ! static void ergo_initialize(); static void global_initialize(); static size_t first_chunk_word_size() { return _first_chunk_word_size; } static size_t first_class_chunk_word_size() { return _first_class_chunk_word_size; } + static size_t reserve_alignment() { return _reserve_alignment; } + static size_t reserve_alignment_words() { return _reserve_alignment / BytesPerWord; } + static size_t commit_alignment() { return _commit_alignment; } + static size_t commit_alignment_words() { return _commit_alignment / BytesPerWord; } + char* bottom() const; size_t used_words_slow(MetadataType mdtype) const; size_t free_words_slow(MetadataType mdtype) const; size_t capacity_words_slow(MetadataType mdtype) const;
*** 217,226 **** --- 229,241 ---- // Free empty virtualspaces static void purge(MetadataType mdtype); static void purge(); + static void report_metadata_oome(ClassLoaderData* loader_data, size_t word_size, + MetadataType mdtype, TRAPS); + void print_on(outputStream* st) const; // Debugging support void verify(); class AllocRecordClosure : public StackObj {
*** 350,403 **** // This class implements a policy for inducing GC's to recover // Metaspaces. class MetaspaceGC : AllStatic { ! // The current high-water-mark for inducing a GC. When ! // the capacity of all space in the virtual lists reaches this value, ! // a GC is induced and the value is increased. This should be changed ! // to the space actually used for allocations to avoid affects of ! // fragmentation losses to partially used chunks. Size is in words. ! static size_t _capacity_until_GC; ! ! // After a GC is done any allocation that fails should try to expand ! // the capacity of the Metaspaces. This flag is set during attempts ! // to allocate in the VMGCOperation that does the GC. ! static bool _expand_after_GC; // For a CMS collection, signal that a concurrent collection should // be started. static bool _should_concurrent_collect; static uint _shrink_factor; - static void set_capacity_until_GC(size_t v) { _capacity_until_GC = v; } - static size_t shrink_factor() { return _shrink_factor; } void set_shrink_factor(uint v) { _shrink_factor = v; } public: ! static size_t capacity_until_GC() { return _capacity_until_GC; } ! static void inc_capacity_until_GC(size_t v) { _capacity_until_GC += v; } ! static void dec_capacity_until_GC(size_t v) { ! _capacity_until_GC = _capacity_until_GC > v ? _capacity_until_GC - v : 0; ! } ! static bool expand_after_GC() { return _expand_after_GC; } ! static void set_expand_after_GC(bool v) { _expand_after_GC = v; } static bool should_concurrent_collect() { return _should_concurrent_collect; } static void set_should_concurrent_collect(bool v) { _should_concurrent_collect = v; } // The amount to increase the high-water-mark (_capacity_until_GC) ! static size_t delta_capacity_until_GC(size_t word_size); ! // It is expected that this will be called when the current capacity ! // has been used and a GC should be considered. ! static bool should_expand(VirtualSpaceList* vsl, size_t word_size); // Calculate the new high-water mark at which to induce // a GC. static void compute_new_size(); }; --- 365,410 ---- // This class implements a policy for inducing GC's to recover // Metaspaces. class MetaspaceGC : AllStatic { ! // The current high-water-mark for inducing a GC. ! // When committed memory of all metaspaces reaches this value, ! // a GC is induced and the value is increased. Size is in bytes. ! static volatile intptr_t _capacity_until_GC; // For a CMS collection, signal that a concurrent collection should // be started. static bool _should_concurrent_collect; static uint _shrink_factor; static size_t shrink_factor() { return _shrink_factor; } void set_shrink_factor(uint v) { _shrink_factor = v; } public: ! static void initialize() { _capacity_until_GC = MetaspaceSize; } ! ! static size_t capacity_until_GC(); ! static size_t inc_capacity_until_GC(size_t v); ! static size_t dec_capacity_until_GC(size_t v); static bool should_concurrent_collect() { return _should_concurrent_collect; } static void set_should_concurrent_collect(bool v) { _should_concurrent_collect = v; } // The amount to increase the high-water-mark (_capacity_until_GC) ! static size_t delta_capacity_until_GC(size_t bytes); ! ! // Tells if we have can expand metaspace without hitting set limits. ! static bool can_expand(size_t words, bool is_class); ! // Returns amount that we can expand without hitting a GC, ! // measured in words. ! static size_t allowed_expansion(); // Calculate the new high-water mark at which to induce // a GC. static void compute_new_size(); };
src/share/vm/memory/metaspace.hpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File