Skip to content
Permalink
Browse files
8251158: Implementation of JEP 387: Elastic Metaspace
Reviewed-by: lkorinth, coleenp, iklam, rrich
  • Loading branch information
tstuefe committed Oct 20, 2020
1 parent 5fedfa7 commit 7ba6a6bf003b810e9f48cb755abe39b1376ad3fe
Showing with 15,681 additions and 7,919 deletions.
  1. +4 −0 src/hotspot/share/classfile/classLoaderData.cpp
  2. +1 −0 src/hotspot/share/classfile/classLoaderData.hpp
  3. +0 −18 src/hotspot/share/classfile/classLoaderDataGraph.cpp
  4. +0 −8 src/hotspot/share/classfile/classLoaderDataGraph.hpp
  5. +9 −6 src/hotspot/share/classfile/classLoaderStats.cpp
  6. +1 −1 src/hotspot/share/gc/g1/g1CollectedHeap.cpp
  7. +1 −1 src/hotspot/share/gc/parallel/psParallelCompact.cpp
  8. +1 −1 src/hotspot/share/gc/shared/collectedHeap.cpp
  9. +1 −0 src/hotspot/share/gc/shared/gcVMOperations.cpp
  10. +1 −0 src/hotspot/share/gc/shared/gcVMOperations.hpp
  11. +2 −1 src/hotspot/share/gc/shared/genCollectedHeap.cpp
  12. +1 −2 src/hotspot/share/gc/shared/generationSpec.cpp
  13. +1 −13 src/hotspot/share/gc/shared/jvmFlagConstraintsGC.cpp
  14. +0 −1 src/hotspot/share/gc/shared/jvmFlagConstraintsGC.hpp
  15. +2 −2 src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp
  16. +1 −0 src/hotspot/share/gc/shenandoah/shenandoahHeap.hpp
  17. +1 −1 src/hotspot/share/gc/shenandoah/shenandoahUnload.cpp
  18. +1 −0 src/hotspot/share/gc/z/zCollectedHeap.cpp
  19. +1 −0 src/hotspot/share/gc/z/zCollectedHeap.hpp
  20. +1 −2 src/hotspot/share/gc/z/zStat.cpp
  21. +1 −1 src/hotspot/share/gc/z/zUnload.cpp
  22. +1 −1 src/hotspot/share/jfr/recorder/checkpoint/types/jfrType.cpp
  23. +1 −0 src/hotspot/share/jvmci/jvmciCompilerToVM.hpp
  24. +1 −0 src/hotspot/share/memory/allocation.hpp
  25. +0 −393 src/hotspot/share/memory/binaryTreeDictionary.hpp
  26. +0 −1,004 src/hotspot/share/memory/binaryTreeDictionary.inline.hpp
  27. +187 −0 src/hotspot/share/memory/classLoaderMetaspace.cpp
  28. +111 −0 src/hotspot/share/memory/classLoaderMetaspace.hpp
  29. +0 −175 src/hotspot/share/memory/freeList.hpp
  30. +0 −330 src/hotspot/share/memory/freeList.inline.hpp
  31. +1 −0 src/hotspot/share/memory/metadataFactory.hpp
  32. +263 −952 src/hotspot/share/memory/metaspace.cpp
  33. +86 −300 src/hotspot/share/memory/metaspace.hpp
  34. +116 −0 src/hotspot/share/memory/metaspace/allocationGuard.hpp
  35. +200 −0 src/hotspot/share/memory/metaspace/binList.hpp
  36. +0 −109 src/hotspot/share/memory/metaspace/blockFreelist.cpp
  37. +0 −92 src/hotspot/share/memory/metaspace/blockFreelist.hpp
  38. +198 −0 src/hotspot/share/memory/metaspace/blockTree.cpp
  39. +379 −0 src/hotspot/share/memory/metaspace/blockTree.hpp
  40. +92 −0 src/hotspot/share/memory/metaspace/chunkHeaderPool.cpp
  41. +135 −0 src/hotspot/share/memory/metaspace/chunkHeaderPool.hpp
  42. +327 −543 src/hotspot/share/memory/metaspace/chunkManager.cpp
  43. +151 −161 src/hotspot/share/memory/metaspace/chunkManager.hpp
  44. +22 −23 src/hotspot/share/memory/metaspace/{metaDebug.cpp → chunklevel.cpp}
  45. +130 −0 src/hotspot/share/memory/metaspace/chunklevel.hpp
  46. +21 −27 src/hotspot/share/memory/metaspace/{smallBlocks.cpp → commitLimiter.cpp}
  47. +84 −0 src/hotspot/share/memory/metaspace/commitLimiter.hpp
  48. +97 −0 src/hotspot/share/memory/metaspace/commitMask.cpp
  49. +165 −0 src/hotspot/share/memory/metaspace/commitMask.hpp
  50. +173 −0 src/hotspot/share/memory/metaspace/counters.hpp
  51. +64 −0 src/hotspot/share/memory/metaspace/freeBlocks.cpp
  52. +113 −0 src/hotspot/share/memory/metaspace/freeBlocks.hpp
  53. +173 −0 src/hotspot/share/memory/metaspace/freeChunkList.cpp
  54. +270 −0 src/hotspot/share/memory/metaspace/freeChunkList.hpp
  55. +21 −20 src/hotspot/share/memory/metaspace/{metablock.hpp → internalStats.cpp}
  56. +127 −0 src/hotspot/share/memory/metaspace/internalStats.hpp
  57. +0 −80 src/hotspot/share/memory/metaspace/metabase.hpp
  58. +244 −107 src/hotspot/share/memory/metaspace/metachunk.cpp
  59. +326 −129 src/hotspot/share/memory/metaspace/metachunk.hpp
  60. +107 −0 src/hotspot/share/memory/metaspace/metachunkList.cpp
  61. +103 −0 src/hotspot/share/memory/metaspace/metachunkList.hpp
  62. +497 −0 src/hotspot/share/memory/metaspace/metaspaceArena.cpp
  63. +180 −0 src/hotspot/share/memory/metaspace/metaspaceArena.hpp
  64. +126 −0 src/hotspot/share/memory/metaspace/metaspaceArenaGrowthPolicy.cpp
  65. +79 −0 src/hotspot/share/memory/metaspace/metaspaceArenaGrowthPolicy.hpp
  66. +74 −90 src/hotspot/share/memory/metaspace/metaspaceCommon.cpp
  67. +81 −85 src/hotspot/share/memory/metaspace/metaspaceCommon.hpp
  68. +86 −0 src/hotspot/share/memory/metaspace/metaspaceContext.cpp
  69. +111 −0 src/hotspot/share/memory/metaspace/metaspaceContext.hpp
  70. +21 −23 src/hotspot/share/memory/metaspace/metaspaceDCmd.cpp
  71. +2 −3 src/hotspot/share/memory/metaspace/metaspaceDCmd.hpp
  72. +372 −0 src/hotspot/share/memory/metaspace/metaspaceReporter.cpp
  73. +64 −0 src/hotspot/share/memory/metaspace/metaspaceReporter.hpp
  74. +108 −0 src/hotspot/share/memory/metaspace/metaspaceSettings.cpp
  75. +100 −0 src/hotspot/share/memory/metaspace/metaspaceSettings.hpp
  76. +8 −8 src/hotspot/share/memory/metaspace/metaspaceSizesSnapshot.cpp
  77. +3 −0 src/hotspot/share/memory/metaspace/metaspaceSizesSnapshot.hpp
  78. +109 −140 src/hotspot/share/memory/metaspace/metaspaceStatistics.cpp
  79. +90 −108 src/hotspot/share/memory/metaspace/metaspaceStatistics.hpp
  80. +0 −135 src/hotspot/share/memory/metaspace/occupancyMap.cpp
  81. +0 −242 src/hotspot/share/memory/metaspace/occupancyMap.hpp
  82. +20 −18 src/hotspot/share/memory/metaspace/printCLDMetaspaceInfoClosure.cpp
  83. +5 −4 src/hotspot/share/memory/metaspace/printCLDMetaspaceInfoClosure.hpp
  84. +2 −4 src/hotspot/share/memory/metaspace/printMetaspaceInfoKlassClosure.cpp
  85. +512 −0 src/hotspot/share/memory/metaspace/rootChunkArea.cpp
  86. +207 −0 src/hotspot/share/memory/metaspace/rootChunkArea.hpp
  87. +97 −0 src/hotspot/share/memory/metaspace/runningCounters.cpp
  88. +76 −0 src/hotspot/share/memory/metaspace/runningCounters.hpp
  89. +0 −88 src/hotspot/share/memory/metaspace/smallBlocks.hpp
  90. +0 −529 src/hotspot/share/memory/metaspace/spaceManager.cpp
  91. +0 −233 src/hotspot/share/memory/metaspace/spaceManager.hpp
  92. +121 −0 src/hotspot/share/memory/metaspace/testHelpers.cpp
  93. +119 −0 src/hotspot/share/memory/metaspace/testHelpers.hpp
  94. +172 −365 src/hotspot/share/memory/metaspace/virtualSpaceList.cpp
  95. +82 −101 src/hotspot/share/memory/metaspace/virtualSpaceList.hpp
  96. +352 −467 src/hotspot/share/memory/metaspace/virtualSpaceNode.cpp
  97. +224 −98 src/hotspot/share/memory/metaspace/virtualSpaceNode.hpp
  98. +2 −0 src/hotspot/share/memory/metaspaceChunkFreeListSummary.hpp
  99. +1 −1 src/hotspot/share/memory/metaspaceClosure.hpp
  100. +2 −2 src/hotspot/share/memory/metaspaceCounters.cpp
  101. +2 −1 src/hotspot/share/memory/metaspaceCounters.hpp
  102. +1 −2 src/hotspot/share/memory/metaspaceTracer.hpp
  103. +1 −1 src/hotspot/share/memory/universe.cpp
  104. +74 −11 src/hotspot/share/prims/whitebox.cpp
  105. +9 −1 src/hotspot/share/runtime/globals.hpp
  106. +2 −1 src/hotspot/share/runtime/vmOperations.cpp
  107. +0 −1 src/hotspot/share/runtime/vmStructs.cpp
  108. +5 −4 src/hotspot/share/services/memReporter.cpp
  109. +1 −0 src/hotspot/share/services/memoryService.hpp
  110. +3 −4 src/hotspot/share/services/virtualMemoryTracker.cpp
  111. +1 −1 src/hotspot/share/services/virtualMemoryTracker.hpp
  112. +0 −69 test/hotspot/gtest/memory/test_chunkManager.cpp
  113. +0 −98 test/hotspot/gtest/memory/test_metachunk.cpp
  114. +0 −273 test/hotspot/gtest/memory/test_metaspace_allocation.cpp
  115. +0 −74 test/hotspot/gtest/memory/test_spaceManager.cpp
  116. +98 −0 test/hotspot/gtest/metaspace/metaspaceGtestCommon.cpp
  117. +219 −0 test/hotspot/gtest/metaspace/metaspaceGtestCommon.hpp
  118. +173 −0 test/hotspot/gtest/metaspace/metaspaceGtestContexts.cpp
  119. +125 −0 test/hotspot/gtest/metaspace/metaspaceGtestContexts.hpp
  120. +184 −0 test/hotspot/gtest/metaspace/metaspaceGtestRangeHelpers.hpp
  121. +164 −0 test/hotspot/gtest/metaspace/metaspaceGtestSparseArray.hpp
  122. +70 −0 test/hotspot/gtest/metaspace/test_allocationGuard.cpp
  123. +72 −0 test/hotspot/gtest/metaspace/test_arenagrowthpolicy.cpp
  124. +228 −0 test/hotspot/gtest/metaspace/test_binlist.cpp
  125. +409 −0 test/hotspot/gtest/metaspace/test_blocktree.cpp
  126. +293 −0 test/hotspot/gtest/metaspace/test_chunkManager_stress.cpp
  127. +153 −0 test/hotspot/gtest/metaspace/test_chunkheaderpool.cpp
  128. +350 −0 test/hotspot/gtest/metaspace/test_commitmask.cpp
  129. +231 −0 test/hotspot/gtest/metaspace/test_freeblocks.cpp
  130. +43 −0 test/hotspot/gtest/metaspace/test_internstats.cpp
  131. +20 −23 test/hotspot/gtest/{memory → metaspace}/test_is_metaspace_obj.cpp
  132. +421 −0 test/hotspot/gtest/metaspace/test_metachunk.cpp
  133. +275 −0 test/hotspot/gtest/metaspace/test_metachunklist.cpp
  134. +3 −15 test/hotspot/gtest/{memory/test_metaspace.cpp → metaspace/test_metaspaceUtils.cpp}
  135. +111 −0 test/hotspot/gtest/metaspace/test_metaspace_misc.cpp
  136. +741 −0 test/hotspot/gtest/metaspace/test_metaspacearena.cpp
  137. +446 −0 test/hotspot/gtest/metaspace/test_metaspacearena_stress.cpp
  138. +593 −0 test/hotspot/gtest/metaspace/test_virtualspacenode.cpp
  139. +11 −1 test/hotspot/jtreg/TEST.groups
  140. +1 −2 test/hotspot/jtreg/gc/TestSystemGC.java
  141. +8 −2 test/hotspot/jtreg/gc/class_unloading/TestG1ClassUnloadingHWM.java
  142. +2 −2 test/hotspot/jtreg/gc/metaspace/CompressedClassSpaceSizeInJmapHeap.java
  143. +11 −3 test/hotspot/jtreg/gtest/GTestWrapper.java
  144. +94 −0 test/hotspot/jtreg/gtest/MetaspaceGtests.java
  145. +0 −1 test/hotspot/jtreg/runtime/CommandLine/OptionsValidation/TestOptionsWithRanges.java
  146. +3 −1 test/hotspot/jtreg/runtime/CompressedOops/CompressedClassSpaceSize.java
  147. +6 −3 test/hotspot/jtreg/runtime/Metaspace/MaxMetaspaceSizeTest.java
  148. +58 −16 test/hotspot/jtreg/runtime/Metaspace/PrintMetaspaceDcmd.java
  149. +20 −25 ...ry/metaspaceGCThresholdUpdater.hpp → test/hotspot/jtreg/runtime/Metaspace/elastic/Allocation.java
  150. +74 −0 test/hotspot/jtreg/runtime/Metaspace/elastic/AllocationProfile.java
  151. +117 −0 test/hotspot/jtreg/runtime/Metaspace/elastic/MetaspaceTestArena.java
  152. +244 −0 test/hotspot/jtreg/runtime/Metaspace/elastic/MetaspaceTestContext.java
  153. +103 −0 test/hotspot/jtreg/runtime/Metaspace/elastic/MetaspaceTestManyArenasManyThreads.java
  154. +80 −0 test/hotspot/jtreg/runtime/Metaspace/elastic/MetaspaceTestOneArenaManyThreads.java
  155. +107 −0 test/hotspot/jtreg/runtime/Metaspace/elastic/MetaspaceTestWithThreads.java
  156. +110 −0 test/hotspot/jtreg/runtime/Metaspace/elastic/RandomAllocator.java
  157. +67 −0 test/hotspot/jtreg/runtime/Metaspace/elastic/RandomAllocatorThread.java
  158. +47 −0 test/hotspot/jtreg/runtime/Metaspace/elastic/RandomHelper.java
  159. +18 −27 ...share/memory/metaspace/metaDebug.hpp → test/hotspot/jtreg/runtime/Metaspace/elastic/Settings.java
  160. +86 −0 test/hotspot/jtreg/runtime/Metaspace/elastic/TestMetaspaceAllocation.java
  161. +122 −0 test/hotspot/jtreg/runtime/Metaspace/elastic/TestMetaspaceAllocationMT1.java
  162. +123 −0 test/hotspot/jtreg/runtime/Metaspace/elastic/TestMetaspaceAllocationMT2.java
  163. +0 −1 test/hotspot/jtreg/runtime/cds/MaxMetaspaceSize.java
  164. +0 −6 test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/LargePages.java
  165. +0 −1 test/hotspot/jtreg/vmTestbase/metaspace/gc/MetaspaceBaseGC.java
  166. +9 −0 test/jdk/java/lang/management/MemoryMXBean/LowMemoryTest2.sh
  167. +14 −1 test/lib/sun/hotspot/WhiteBox.java
@@ -58,7 +58,9 @@
#include "logging/log.hpp"
#include "logging/logStream.hpp"
#include "memory/allocation.inline.hpp"
#include "memory/classLoaderMetaspace.hpp"
#include "memory/metadataFactory.hpp"
#include "memory/metaspace.hpp"
#include "memory/resourceArea.hpp"
#include "memory/universe.hpp"
#include "oops/access.inline.hpp"
@@ -953,9 +955,11 @@ void ClassLoaderData::verify() {
guarantee(cl != NULL || this == ClassLoaderData::the_null_class_loader_data() || has_class_mirror_holder(), "must be");

// Verify the integrity of the allocated space.
#ifdef ASSERT
if (metaspace_or_null() != NULL) {
metaspace_or_null()->verify();
}
#endif

for (Klass* k = _klasses; k != NULL; k = k->next_link()) {
guarantee(k->class_loader_data() == this, "Must be the same");
@@ -62,6 +62,7 @@ class ModuleEntryTable;
class PackageEntryTable;
class DictionaryEntry;
class Dictionary;
class ClassLoaderMetaspace;

// ClassLoaderData class

@@ -661,24 +661,6 @@ Klass* ClassLoaderDataGraphKlassIteratorAtomic::next_klass() {
return NULL;
}

ClassLoaderDataGraphMetaspaceIterator::ClassLoaderDataGraphMetaspaceIterator() {
assert(SafepointSynchronize::is_at_safepoint(), "must be at safepoint!");
_data = ClassLoaderDataGraph::_head;
}

ClassLoaderDataGraphMetaspaceIterator::~ClassLoaderDataGraphMetaspaceIterator() {}

ClassLoaderMetaspace* ClassLoaderDataGraphMetaspaceIterator::get_next() {
assert(_data != NULL, "Should not be NULL in call to the iterator");
ClassLoaderMetaspace* result = _data->metaspace_or_null();
_data = _data->next();
// This result might be NULL for class loaders without metaspace
// yet. It would be nice to return only non-null results but
// there is no guarantee that there will be a non-null result
// down the list so the caller is going to have to check.
return result;
}

void ClassLoaderDataGraph::verify() {
ClassLoaderDataGraphIterator iter;
while (ClassLoaderData* cld = iter.get_next()) {
@@ -162,12 +162,4 @@ class ClassLoaderDataGraphKlassIteratorAtomic : public StackObj {
static Klass* next_klass_in_cldg(Klass* klass);
};

class ClassLoaderDataGraphMetaspaceIterator : public StackObj {
ClassLoaderData* _data;
public:
ClassLoaderDataGraphMetaspaceIterator();
~ClassLoaderDataGraphMetaspaceIterator();
bool repeat() { return _data != NULL; }
ClassLoaderMetaspace* get_next();
};
#endif // SHARE_CLASSFILE_CLASSLOADERDATAGRAPH_HPP
@@ -26,6 +26,7 @@
#include "classfile/classLoaderData.inline.hpp"
#include "classfile/classLoaderDataGraph.hpp"
#include "classfile/classLoaderStats.hpp"
#include "memory/classLoaderMetaspace.hpp"
#include "oops/objArrayKlass.hpp"
#include "oops/oop.inline.hpp"
#include "utilities/globalDefinitions.hpp"
@@ -80,15 +81,17 @@ void ClassLoaderStatsClosure::do_cld(ClassLoaderData* cld) {

ClassLoaderMetaspace* ms = cld->metaspace_or_null();
if (ms != NULL) {
size_t used_bytes, capacity_bytes;
ms->calculate_jfr_stats(&used_bytes, &capacity_bytes);
if(cld->has_class_mirror_holder()) {
cls->_hidden_chunk_sz += ms->allocated_chunks_bytes();
cls->_hidden_block_sz += ms->allocated_blocks_bytes();
cls->_hidden_chunk_sz += capacity_bytes;
cls->_hidden_block_sz += used_bytes;
} else {
cls->_chunk_sz = ms->allocated_chunks_bytes();
cls->_block_sz = ms->allocated_blocks_bytes();
cls->_chunk_sz = capacity_bytes;
cls->_block_sz = used_bytes;
}
_total_chunk_sz += ms->allocated_chunks_bytes();
_total_block_sz += ms->allocated_blocks_bytes();
_total_chunk_sz += capacity_bytes;
_total_block_sz += used_bytes;
}
}

@@ -1034,7 +1034,7 @@ void G1CollectedHeap::prepare_heap_for_mutators() {

// Delete metaspaces for unloaded class loaders and clean up loader_data graph
ClassLoaderDataGraph::purge(/*at_safepoint*/true);
MetaspaceUtils::verify_metrics();
DEBUG_ONLY(MetaspaceUtils::verify();)

// Prepare heap for normal collections.
assert(num_free_regions() == 0, "we should not have added any free regions");
@@ -1058,7 +1058,7 @@ void PSParallelCompact::post_compact()

// Delete metaspaces for unloaded class loaders and clean up loader_data graph
ClassLoaderDataGraph::purge(/*at_safepoint*/true);
MetaspaceUtils::verify_metrics();
DEBUG_ONLY(MetaspaceUtils::verify();)

heap->prune_scavengable_nmethods();

@@ -37,7 +37,7 @@
#include "gc/shared/memAllocator.hpp"
#include "logging/log.hpp"
#include "logging/logStream.hpp"
#include "memory/metaspace.hpp"
#include "memory/classLoaderMetaspace.hpp"
#include "memory/resourceArea.hpp"
#include "memory/universe.hpp"
#include "oops/instanceMirrorKlass.hpp"
@@ -32,6 +32,7 @@
#include "gc/shared/genCollectedHeap.hpp"
#include "interpreter/oopMapCache.hpp"
#include "logging/log.hpp"
#include "memory/classLoaderMetaspace.hpp"
#include "memory/oopFactory.hpp"
#include "memory/universe.hpp"
#include "runtime/handles.inline.hpp"
@@ -28,6 +28,7 @@
#include "gc/shared/collectedHeap.hpp"
#include "gc/shared/genCollectedHeap.hpp"
#include "memory/heapInspection.hpp"
#include "memory/metaspace.hpp"
#include "prims/jvmtiExport.hpp"
#include "runtime/handles.hpp"
#include "runtime/jniHandles.hpp"
@@ -58,6 +58,7 @@
#include "gc/shared/workgroup.hpp"
#include "memory/filemap.hpp"
#include "memory/iterator.hpp"
#include "memory/metaspace/metaspaceSizesSnapshot.hpp"
#include "memory/metaspaceCounters.hpp"
#include "memory/resourceArea.hpp"
#include "memory/universe.hpp"
@@ -662,7 +663,7 @@ void GenCollectedHeap::do_collection(bool full,

// Delete metaspaces for unloaded class loaders and clean up loader_data graph
ClassLoaderDataGraph::purge(/*at_safepoint*/true);
MetaspaceUtils::verify_metrics();
DEBUG_ONLY(MetaspaceUtils::verify();)
// Resize the metaspace capacity after full collections
MetaspaceGC::compute_new_size();
update_full_collections_completed();
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,6 @@
#include "precompiled.hpp"
#include "gc/shared/cardTableRS.hpp"
#include "gc/shared/generationSpec.hpp"
#include "memory/binaryTreeDictionary.hpp"
#include "memory/filemap.hpp"
#include "runtime/java.hpp"
#include "utilities/macros.hpp"
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -262,18 +262,6 @@ JVMFlag::Error GCPauseIntervalMillisConstraintFunc(uintx value, bool verbose) {
return JVMFlag::SUCCESS;
}

JVMFlag::Error InitialBootClassLoaderMetaspaceSizeConstraintFunc(size_t value, bool verbose) {
size_t aligned_max = align_down(max_uintx/2, Metaspace::reserve_alignment_words());
if (value > aligned_max) {
JVMFlag::printError(verbose,
"InitialBootClassLoaderMetaspaceSize (" SIZE_FORMAT ") must be "
"less than or equal to aligned maximum value (" SIZE_FORMAT ")\n",
value, aligned_max);
return JVMFlag::VIOLATES_CONSTRAINT;
}
return JVMFlag::SUCCESS;
}

// To avoid an overflow by 'align_up(value, alignment)'.
static JVMFlag::Error MaxSizeForAlignment(const char* name, size_t value, size_t alignment, bool verbose) {
size_t aligned_max = ((max_uintx - alignment) & ~(alignment-1));
@@ -56,7 +56,6 @@
\
f(uintx, MaxGCPauseMillisConstraintFunc) \
f(uintx, GCPauseIntervalMillisConstraintFunc) \
f(size_t, InitialBootClassLoaderMetaspaceSizeConstraintFunc) \
f(size_t, MinHeapSizeConstraintFunc) \
f(size_t, InitialHeapSizeConstraintFunc) \
f(size_t, MaxHeapSizeConstraintFunc) \
@@ -71,7 +71,7 @@
#include "gc/shenandoah/shenandoahJfrSupport.hpp"
#endif

#include "memory/metaspace.hpp"
#include "memory/classLoaderMetaspace.hpp"
#include "oops/compressedOops.inline.hpp"
#include "runtime/atomic.hpp"
#include "runtime/globals.hpp"
@@ -2410,7 +2410,7 @@ void ShenandoahHeap::stw_unload_classes(bool full_gc) {
}
// Resize and verify metaspace
MetaspaceGC::compute_new_size();
MetaspaceUtils::verify_metrics();
DEBUG_ONLY(MetaspaceUtils::verify();)
}

// Weak roots are either pre-evacuated (final mark) or updated (final updaterefs),
@@ -35,6 +35,7 @@
#include "gc/shenandoah/shenandoahPadding.hpp"
#include "gc/shenandoah/shenandoahSharedVariables.hpp"
#include "gc/shenandoah/shenandoahUnload.hpp"
#include "memory/metaspace.hpp"
#include "services/memoryManager.hpp"
#include "utilities/globalDefinitions.hpp"
#include "utilities/stack.hpp"
@@ -197,5 +197,5 @@ void ShenandoahUnload::unload() {

void ShenandoahUnload::finish() {
MetaspaceGC::compute_new_size();
MetaspaceUtils::verify_metrics();
DEBUG_ONLY(MetaspaceUtils::verify();)
}
@@ -35,6 +35,7 @@
#include "gc/z/zServiceability.hpp"
#include "gc/z/zStat.hpp"
#include "gc/z/zUtils.inline.hpp"
#include "memory/classLoaderMetaspace.hpp"
#include "memory/iterator.hpp"
#include "memory/universe.hpp"
#include "utilities/align.hpp"
@@ -30,6 +30,7 @@
#include "gc/z/zHeap.hpp"
#include "gc/z/zInitialize.hpp"
#include "gc/z/zRuntimeWorkers.hpp"
#include "memory/metaspace.hpp"

class ZDirector;
class ZDriver;
@@ -1186,10 +1186,9 @@ void ZStatNMethods::print() {
//
void ZStatMetaspace::print() {
log_info(gc, metaspace)("Metaspace: "
SIZE_FORMAT "M used, " SIZE_FORMAT "M capacity, "
SIZE_FORMAT "M used, "
SIZE_FORMAT "M committed, " SIZE_FORMAT "M reserved",
MetaspaceUtils::used_bytes() / M,
MetaspaceUtils::capacity_bytes() / M,
MetaspaceUtils::committed_bytes() / M,
MetaspaceUtils::reserved_bytes() / M);
}
@@ -164,5 +164,5 @@ void ZUnload::purge() {
void ZUnload::finish() {
// Resize and verify metaspace
MetaspaceGC::compute_new_size();
MetaspaceUtils::verify_metrics();
DEBUG_ONLY(MetaspaceUtils::verify();)
}
@@ -41,7 +41,7 @@
#include "jfr/writers/jfrJavaEventWriter.hpp"
#include "jfr/utilities/jfrThreadIterator.hpp"
#include "memory/iterator.hpp"
#include "memory/metaspaceGCThresholdUpdater.hpp"
#include "memory/metaspace.hpp"
#include "memory/referenceType.hpp"
#include "memory/universe.hpp"
#include "oops/compressedOops.hpp"
@@ -29,6 +29,7 @@
#include "runtime/javaCalls.hpp"
#include "runtime/signature.hpp"

class CollectedHeap;
class JVMCIObjectArray;

class CompilerToVM {
@@ -142,6 +142,7 @@ class AllocatedObj {
f(mtSafepoint, "Safepoint") \
f(mtSynchronizer, "Synchronization") \
f(mtServiceability, "Serviceability") \
f(mtMetaspace, "Metaspace") \
f(mtNone, "Unknown") \
//end

2 comments on commit 7ba6a6b

@bridgekeeper

This comment has been minimized.

Copy link

@bridgekeeper bridgekeeper bot replied Oct 20, 2020

@bridgekeeper

This comment has been minimized.

Copy link

@bridgekeeper bridgekeeper bot replied Oct 20, 2020

Please sign in to comment.