annotate src/share/vm/memory/metaspace.hpp @ 9027:26f9044e381f

8133984: print_compressed_class_space() is only defined in 64-bit VM Summary: define method's empty body in 32-bit VM. Reviewed-by: coleenp
author kvn
date Wed, 19 Aug 2015 17:59:00 -0700
parents d47844b56aaf
children 58ffe5f227a6
rev   line source
coleenp@3602 1 /*
shshahma@8827 2 * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
coleenp@3602 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
coleenp@3602 4 *
coleenp@3602 5 * This code is free software; you can redistribute it and/or modify it
coleenp@3602 6 * under the terms of the GNU General Public License version 2 only, as
coleenp@3602 7 * published by the Free Software Foundation.
coleenp@3602 8 *
coleenp@3602 9 * This code is distributed in the hope that it will be useful, but WITHOUT
coleenp@3602 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
coleenp@3602 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
coleenp@3602 12 * version 2 for more details (a copy is included in the LICENSE file that
coleenp@3602 13 * accompanied this code).
coleenp@3602 14 *
coleenp@3602 15 * You should have received a copy of the GNU General Public License version
coleenp@3602 16 * 2 along with this work; if not, write to the Free Software Foundation,
coleenp@3602 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
coleenp@3602 18 *
coleenp@3602 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
coleenp@3602 20 * or visit www.oracle.com if you need additional information or have any
coleenp@3602 21 * questions.
coleenp@3602 22 *
coleenp@3602 23 */
coleenp@3602 24 #ifndef SHARE_VM_MEMORY_METASPACE_HPP
coleenp@3602 25 #define SHARE_VM_MEMORY_METASPACE_HPP
coleenp@3602 26
coleenp@3602 27 #include "memory/allocation.hpp"
coleenp@3602 28 #include "memory/memRegion.hpp"
ehelin@5985 29 #include "memory/metaspaceChunkFreeListSummary.hpp"
coleenp@3602 30 #include "runtime/virtualspace.hpp"
coleenp@3602 31 #include "utilities/exceptions.hpp"
coleenp@3602 32
coleenp@3602 33 // Metaspace
coleenp@3602 34 //
coleenp@3602 35 // Metaspaces are Arenas for the VM's metadata.
coleenp@3602 36 // They are allocated one per class loader object, and one for the null
coleenp@3602 37 // bootstrap class loader
coleenp@3602 38 // Eventually for bootstrap loader we'll have a read-only section and read-write
coleenp@3602 39 // to write for DumpSharedSpaces and read for UseSharedSpaces
coleenp@3602 40 //
coleenp@3602 41 // block X ---+ +-------------------+
coleenp@3602 42 // | | Virtualspace |
coleenp@3602 43 // | | |
coleenp@3602 44 // | | |
coleenp@3602 45 // | |-------------------|
coleenp@3602 46 // | || Chunk |
coleenp@3602 47 // | || |
coleenp@3602 48 // | ||---------- |
coleenp@3602 49 // +------>||| block 0 | |
coleenp@3602 50 // ||---------- |
coleenp@3602 51 // ||| block 1 | |
coleenp@3602 52 // ||---------- |
coleenp@3602 53 // || |
coleenp@3602 54 // |-------------------|
coleenp@3602 55 // | |
coleenp@3602 56 // | |
coleenp@3602 57 // +-------------------+
coleenp@3602 58 //
coleenp@3602 59
stefank@5336 60 class ChunkManager;
coleenp@3602 61 class ClassLoaderData;
jmasa@3761 62 class Metablock;
stefank@5336 63 class Metachunk;
ehelin@5982 64 class MetaspaceTracer;
coleenp@3602 65 class MetaWord;
coleenp@3602 66 class Mutex;
coleenp@3602 67 class outputStream;
coleenp@3602 68 class SpaceManager;
stefank@5336 69 class VirtualSpaceList;
coleenp@3602 70
coleenp@3602 71 // Metaspaces each have a SpaceManager and allocations
coleenp@3602 72 // are done by the SpaceManager. Allocations are done
coleenp@3602 73 // out of the current Metachunk. When the current Metachunk
coleenp@3602 74 // is exhausted, the SpaceManager gets a new one from
coleenp@3602 75 // the current VirtualSpace. When the VirtualSpace is exhausted
coleenp@3602 76 // the SpaceManager gets a new one. The SpaceManager
coleenp@3602 77 // also manages freelists of available Chunks.
coleenp@3602 78 //
coleenp@3602 79 // Currently the space manager maintains the list of
coleenp@3602 80 // virtual spaces and the list of chunks in use. Its
coleenp@3602 81 // allocate() method returns a block for use as a
coleenp@3602 82 // quantum of metadata.
coleenp@3602 83
coleenp@3602 84 class Metaspace : public CHeapObj<mtClass> {
coleenp@3602 85 friend class VMStructs;
coleenp@3602 86 friend class SpaceManager;
coleenp@3602 87 friend class VM_CollectForMetadataAllocation;
coleenp@3602 88 friend class MetaspaceGC;
coleenp@3602 89 friend class MetaspaceAux;
coleenp@3602 90
coleenp@3602 91 public:
stefank@5428 92 enum MetadataType {
stefank@5428 93 ClassType,
stefank@5428 94 NonClassType,
stefank@5428 95 MetadataTypeCount
jmasa@4727 96 };
jmasa@3947 97 enum MetaspaceType {
jmasa@3947 98 StandardMetaspaceType,
jmasa@3947 99 BootMetaspaceType,
jmasa@3947 100 ROMetaspaceType,
jmasa@3947 101 ReadWriteMetaspaceType,
jmasa@3947 102 AnonymousMetaspaceType,
jmasa@3947 103 ReflectionMetaspaceType
jmasa@3947 104 };
coleenp@3602 105
coleenp@3602 106 private:
mchinnathamb@8675 107 static void verify_global_initialization();
mchinnathamb@8675 108
jmasa@3947 109 void initialize(Mutex* lock, MetaspaceType type);
jmasa@3947 110
mchinnathamb@8675 111 // Initialize the first chunk for a Metaspace. Used for
stefank@5428 112 // special cases such as the boot class loader, reflection
stefank@5428 113 // class loader and anonymous class loader.
mchinnathamb@8675 114 void initialize_first_chunk(MetaspaceType type, MetadataType mdtype);
mchinnathamb@8675 115 Metachunk* get_initialization_chunk(MetaspaceType type, MetadataType mdtype);
stefank@5336 116
jmasa@3947 117 // Align up the word size to the allocation word size
jmasa@3947 118 static size_t align_word_size_up(size_t);
coleenp@3602 119
hseigel@5093 120 // Aligned size of the metaspace.
coleenp@5594 121 static size_t _compressed_class_space_size;
hseigel@5093 122
coleenp@5594 123 static size_t compressed_class_space_size() {
coleenp@5594 124 return _compressed_class_space_size;
hseigel@5093 125 }
goetz@6052 126
coleenp@5594 127 static void set_compressed_class_space_size(size_t size) {
coleenp@5594 128 _compressed_class_space_size = size;
hseigel@5093 129 }
hseigel@5093 130
coleenp@3602 131 static size_t _first_chunk_word_size;
jmasa@3947 132 static size_t _first_class_chunk_word_size;
coleenp@3602 133
stefank@5428 134 static size_t _commit_alignment;
stefank@5428 135 static size_t _reserve_alignment;
stefank@5428 136
coleenp@3602 137 SpaceManager* _vsm;
coleenp@3602 138 SpaceManager* vsm() const { return _vsm; }
coleenp@3602 139
coleenp@3602 140 SpaceManager* _class_vsm;
coleenp@3602 141 SpaceManager* class_vsm() const { return _class_vsm; }
mchinnathamb@8675 142 SpaceManager* get_space_manager(MetadataType mdtype) {
mchinnathamb@8675 143 assert(mdtype != MetadataTypeCount, "MetadaTypeCount can't be used as mdtype");
mchinnathamb@8675 144 return mdtype == ClassType ? class_vsm() : vsm();
mchinnathamb@8675 145 }
coleenp@3602 146
jmasa@4580 147 // Allocate space for metadata of type mdtype. This is space
jmasa@4580 148 // within a Metachunk and is used by
jmasa@4580 149 // allocate(ClassLoaderData*, size_t, bool, MetadataType, TRAPS)
coleenp@3602 150 MetaWord* allocate(size_t word_size, MetadataType mdtype);
coleenp@3602 151
coleenp@3602 152 // Virtual Space lists for both classes and other metadata
coleenp@3602 153 static VirtualSpaceList* _space_list;
coleenp@3602 154 static VirtualSpaceList* _class_space_list;
coleenp@3602 155
stefank@5336 156 static ChunkManager* _chunk_manager_metadata;
stefank@5336 157 static ChunkManager* _chunk_manager_class;
stefank@5336 158
ehelin@5982 159 static const MetaspaceTracer* _tracer;
ehelin@5982 160
stefank@5336 161 public:
coleenp@3602 162 static VirtualSpaceList* space_list() { return _space_list; }
coleenp@3602 163 static VirtualSpaceList* class_space_list() { return _class_space_list; }
ehelin@5096 164 static VirtualSpaceList* get_space_list(MetadataType mdtype) {
ehelin@5096 165 assert(mdtype != MetadataTypeCount, "MetadaTypeCount can't be used as mdtype");
ehelin@5096 166 return mdtype == ClassType ? class_space_list() : space_list();
ehelin@5096 167 }
coleenp@3602 168
stefank@5336 169 static ChunkManager* chunk_manager_metadata() { return _chunk_manager_metadata; }
stefank@5336 170 static ChunkManager* chunk_manager_class() { return _chunk_manager_class; }
stefank@5336 171 static ChunkManager* get_chunk_manager(MetadataType mdtype) {
stefank@5336 172 assert(mdtype != MetadataTypeCount, "MetadaTypeCount can't be used as mdtype");
stefank@5336 173 return mdtype == ClassType ? chunk_manager_class() : chunk_manager_metadata();
stefank@5336 174 }
stefank@5336 175
ehelin@5982 176 static const MetaspaceTracer* tracer() { return _tracer; }
ehelin@5982 177
stefank@5336 178 private:
iklam@6573 179 // These 2 methods are used by DumpSharedSpaces only, where only _vsm is used. So we will
iklam@4773 180 // maintain a single list for now.
iklam@4773 181 void record_allocation(void* ptr, MetaspaceObj::Type type, size_t word_size);
iklam@6573 182 void record_deallocation(void* ptr, size_t word_size);
iklam@4773 183
hseigel@5093 184 #ifdef _LP64
hseigel@5093 185 static void set_narrow_klass_base_and_shift(address metaspace_base, address cds_base);
hseigel@5093 186
hseigel@5093 187 // Returns true if can use CDS with metaspace allocated as specified address.
hseigel@5093 188 static bool can_use_cds_with_metaspace_addr(char* metaspace_base, address cds_base);
hseigel@5093 189
hseigel@5093 190 static void allocate_metaspace_compressed_klass_ptrs(char* requested_addr, address cds_base);
hseigel@5093 191
hseigel@5093 192 static void initialize_class_space(ReservedSpace rs);
hseigel@5093 193 #endif
hseigel@5093 194
iklam@4773 195 class AllocRecord : public CHeapObj<mtClass> {
iklam@4773 196 public:
iklam@4773 197 AllocRecord(address ptr, MetaspaceObj::Type type, int byte_size)
iklam@4773 198 : _next(NULL), _ptr(ptr), _type(type), _byte_size(byte_size) {}
iklam@4773 199 AllocRecord *_next;
iklam@4773 200 address _ptr;
iklam@4773 201 MetaspaceObj::Type _type;
iklam@4773 202 int _byte_size;
iklam@4773 203 };
iklam@4773 204
iklam@4773 205 AllocRecord * _alloc_record_head;
iklam@4773 206 AllocRecord * _alloc_record_tail;
iklam@4773 207
hseigel@5592 208 size_t class_chunk_size(size_t word_size);
hseigel@5592 209
coleenp@3602 210 public:
coleenp@3602 211
jmasa@3947 212 Metaspace(Mutex* lock, MetaspaceType type);
coleenp@3602 213 ~Metaspace();
coleenp@3602 214
stefank@5428 215 static void ergo_initialize();
coleenp@3602 216 static void global_initialize();
ehelin@6287 217 static void post_initialize();
coleenp@3602 218
coleenp@3602 219 static size_t first_chunk_word_size() { return _first_chunk_word_size; }
jmasa@3947 220 static size_t first_class_chunk_word_size() { return _first_class_chunk_word_size; }
coleenp@3602 221
stefank@5428 222 static size_t reserve_alignment() { return _reserve_alignment; }
stefank@5428 223 static size_t reserve_alignment_words() { return _reserve_alignment / BytesPerWord; }
stefank@5428 224 static size_t commit_alignment() { return _commit_alignment; }
stefank@5428 225 static size_t commit_alignment_words() { return _commit_alignment / BytesPerWord; }
stefank@5428 226
coleenp@3602 227 char* bottom() const;
jmasa@4580 228 size_t used_words_slow(MetadataType mdtype) const;
ehelin@5268 229 size_t free_words_slow(MetadataType mdtype) const;
jmasa@4580 230 size_t capacity_words_slow(MetadataType mdtype) const;
coleenp@3602 231
jmasa@4580 232 size_t used_bytes_slow(MetadataType mdtype) const;
jmasa@4580 233 size_t capacity_bytes_slow(MetadataType mdtype) const;
jmasa@4580 234
dbuck@8680 235 size_t allocated_blocks_bytes() const;
dbuck@8680 236 size_t allocated_chunks_bytes() const;
dbuck@8680 237
stefank@5506 238 static MetaWord* allocate(ClassLoaderData* loader_data, size_t word_size,
stefank@5506 239 bool read_only, MetaspaceObj::Type type, TRAPS);
jmasa@3629 240 void deallocate(MetaWord* ptr, size_t byte_size, bool is_class);
coleenp@3602 241
jmasa@3629 242 MetaWord* expand_and_allocate(size_t size,
jmasa@3629 243 MetadataType mdtype);
coleenp@3602 244
coleenp@6243 245 static bool contains(const void* ptr);
coleenp@6243 246
coleenp@3602 247 void dump(outputStream* const out) const;
coleenp@3602 248
jmasa@4572 249 // Free empty virtualspaces
stefank@5336 250 static void purge(MetadataType mdtype);
jmasa@4572 251 static void purge();
jmasa@4572 252
stefank@5428 253 static void report_metadata_oome(ClassLoaderData* loader_data, size_t word_size,
ehelin@5984 254 MetaspaceObj::Type type, MetadataType mdtype, TRAPS);
stefank@5428 255
ehelin@5983 256 static const char* metadata_type_name(Metaspace::MetadataType mdtype);
ehelin@5983 257
coleenp@3602 258 void print_on(outputStream* st) const;
coleenp@3602 259 // Debugging support
coleenp@3602 260 void verify();
iklam@4773 261
kvn@9027 262 static void print_compressed_class_space(outputStream* st, const char* requested_addr = 0) NOT_LP64({});
shshahma@8827 263
iklam@4773 264 class AllocRecordClosure : public StackObj {
iklam@4773 265 public:
iklam@4773 266 virtual void doit(address ptr, MetaspaceObj::Type type, int byte_size) = 0;
iklam@4773 267 };
iklam@4773 268
iklam@4773 269 void iterate(AllocRecordClosure *closure);
hseigel@5093 270
ehelin@5259 271 // Return TRUE only if UseCompressedClassPointers is True and DumpSharedSpaces is False.
hseigel@5093 272 static bool using_class_space() {
ehelin@5259 273 return NOT_LP64(false) LP64_ONLY(UseCompressedClassPointers && !DumpSharedSpaces);
hseigel@5093 274 }
hseigel@5093 275
mgerdin@5373 276 static bool is_class_space_allocation(MetadataType mdType) {
mgerdin@5373 277 return mdType == ClassType && using_class_space();
mgerdin@5373 278 }
hseigel@5592 279
coleenp@3602 280 };
coleenp@3602 281
coleenp@3602 282 class MetaspaceAux : AllStatic {
ehelin@5268 283 static size_t free_chunks_total_words(Metaspace::MetadataType mdtype);
jmasa@4580 284
jmasa@4580 285 // These methods iterate over the classloader data graph
jmasa@4580 286 // for the given Metaspace type. These are slow.
jmasa@4580 287 static size_t used_bytes_slow(Metaspace::MetadataType mdtype);
ehelin@5268 288 static size_t free_bytes_slow(Metaspace::MetadataType mdtype);
jmasa@4580 289 static size_t capacity_bytes_slow(Metaspace::MetadataType mdtype);
ehelin@5268 290 static size_t capacity_bytes_slow();
coleenp@3602 291
jmasa@4580 292 // Running sum of space in all Metachunks that has been
jmasa@4580 293 // allocated to a Metaspace. This is used instead of
jmasa@4727 294 // iterating over all the classloaders. One for each
jmasa@4727 295 // type of Metadata
ehelin@6174 296 static size_t _capacity_words[Metaspace:: MetadataTypeCount];
ehelin@6174 297 // Running sum of space in all Metachunks that
jmasa@4727 298 // are being used for metadata. One for each
jmasa@4727 299 // type of Metadata.
ehelin@6174 300 static size_t _used_words[Metaspace:: MetadataTypeCount];
jmasa@4580 301
jmasa@4580 302 public:
jmasa@4580 303 // Decrement and increment _allocated_capacity_words
jmasa@4727 304 static void dec_capacity(Metaspace::MetadataType type, size_t words);
jmasa@4727 305 static void inc_capacity(Metaspace::MetadataType type, size_t words);
jmasa@4580 306
jmasa@4580 307 // Decrement and increment _allocated_used_words
jmasa@4727 308 static void dec_used(Metaspace::MetadataType type, size_t words);
jmasa@4727 309 static void inc_used(Metaspace::MetadataType type, size_t words);
jmasa@4580 310
jmasa@4580 311 // Total of space allocated to metadata in all Metaspaces.
jmasa@4580 312 // This sums the space used in each Metachunk by
jmasa@4580 313 // iterating over the classloader data graph
jmasa@4580 314 static size_t used_bytes_slow() {
jmasa@4580 315 return used_bytes_slow(Metaspace::ClassType) +
jmasa@4580 316 used_bytes_slow(Metaspace::NonClassType);
stefank@3936 317 }
coleenp@3602 318
jmasa@4580 319 // Used by MetaspaceCounters
ehelin@5268 320 static size_t free_chunks_total_words();
ehelin@5268 321 static size_t free_chunks_total_bytes();
ehelin@5268 322 static size_t free_chunks_total_bytes(Metaspace::MetadataType mdtype);
jmasa@4580 323
ehelin@6174 324 static size_t capacity_words(Metaspace::MetadataType mdtype) {
ehelin@6174 325 return _capacity_words[mdtype];
jmasa@4727 326 }
ehelin@6174 327 static size_t capacity_words() {
ehelin@6174 328 return capacity_words(Metaspace::NonClassType) +
ehelin@6174 329 capacity_words(Metaspace::ClassType);
jmasa@4727 330 }
ehelin@6174 331 static size_t capacity_bytes(Metaspace::MetadataType mdtype) {
ehelin@6174 332 return capacity_words(mdtype) * BytesPerWord;
jmasa@4580 333 }
ehelin@6174 334 static size_t capacity_bytes() {
ehelin@6174 335 return capacity_words() * BytesPerWord;
jmasa@4580 336 }
jmasa@4580 337
ehelin@6174 338 static size_t used_words(Metaspace::MetadataType mdtype) {
ehelin@6174 339 return _used_words[mdtype];
jmasa@4727 340 }
ehelin@6174 341 static size_t used_words() {
ehelin@6174 342 return used_words(Metaspace::NonClassType) +
ehelin@6174 343 used_words(Metaspace::ClassType);
jmasa@4727 344 }
ehelin@6174 345 static size_t used_bytes(Metaspace::MetadataType mdtype) {
ehelin@6174 346 return used_words(mdtype) * BytesPerWord;
jmasa@4580 347 }
ehelin@6174 348 static size_t used_bytes() {
ehelin@6174 349 return used_words() * BytesPerWord;
jmasa@4580 350 }
jmasa@4580 351
jmasa@4580 352 static size_t free_bytes();
ehelin@5096 353 static size_t free_bytes(Metaspace::MetadataType mdtype);
jmasa@4580 354
ehelin@5268 355 static size_t reserved_bytes(Metaspace::MetadataType mdtype);
ehelin@5268 356 static size_t reserved_bytes() {
ehelin@5268 357 return reserved_bytes(Metaspace::ClassType) +
ehelin@5268 358 reserved_bytes(Metaspace::NonClassType);
stefank@3936 359 }
coleenp@3602 360
stefank@5269 361 static size_t committed_bytes(Metaspace::MetadataType mdtype);
stefank@5269 362 static size_t committed_bytes() {
stefank@5269 363 return committed_bytes(Metaspace::ClassType) +
stefank@5269 364 committed_bytes(Metaspace::NonClassType);
stefank@5269 365 }
stefank@5269 366
ehelin@5268 367 static size_t min_chunk_size_words();
ehelin@5268 368 static size_t min_chunk_size_bytes() {
ehelin@5268 369 return min_chunk_size_words() * BytesPerWord;
stefank@3936 370 }
coleenp@3602 371
ehelin@5985 372 static bool has_chunk_free_list(Metaspace::MetadataType mdtype);
ehelin@5985 373 static MetaspaceChunkFreeListSummary chunk_free_list_summary(Metaspace::MetadataType mdtype);
ehelin@5985 374
coleenp@3602 375 // Print change in used metadata.
coleenp@3602 376 static void print_metaspace_change(size_t prev_metadata_used);
coleenp@3602 377 static void print_on(outputStream * out);
coleenp@3602 378 static void print_on(outputStream * out, Metaspace::MetadataType mdtype);
coleenp@3602 379
hseigel@5093 380 static void print_class_waste(outputStream* out);
coleenp@3602 381 static void print_waste(outputStream* out);
coleenp@3602 382 static void dump(outputStream* out);
mgerdin@3829 383 static void verify_free_chunks();
jmasa@4580 384 // Checks that the values returned by allocated_capacity_bytes() and
jmasa@4580 385 // capacity_bytes_slow() are the same.
jmasa@4580 386 static void verify_capacity();
jmasa@4580 387 static void verify_used();
jmasa@4580 388 static void verify_metrics();
coleenp@3602 389 };
coleenp@3602 390
coleenp@3602 391 // Metaspace are deallocated when their class loader are GC'ed.
coleenp@3602 392 // This class implements a policy for inducing GC's to recover
coleenp@3602 393 // Metaspaces.
coleenp@3602 394
coleenp@3602 395 class MetaspaceGC : AllStatic {
coleenp@3602 396
stefank@5428 397 // The current high-water-mark for inducing a GC.
stefank@5428 398 // When committed memory of all metaspaces reaches this value,
stefank@5428 399 // a GC is induced and the value is increased. Size is in bytes.
stefank@5428 400 static volatile intptr_t _capacity_until_GC;
coleenp@3602 401
coleenp@3602 402 // For a CMS collection, signal that a concurrent collection should
coleenp@3602 403 // be started.
coleenp@3602 404 static bool _should_concurrent_collect;
coleenp@3602 405
coleenp@3602 406 static uint _shrink_factor;
coleenp@3602 407
coleenp@3602 408 static size_t shrink_factor() { return _shrink_factor; }
coleenp@3602 409 void set_shrink_factor(uint v) { _shrink_factor = v; }
coleenp@3602 410
coleenp@3602 411 public:
coleenp@3602 412
ehelin@6287 413 static void initialize();
ehelin@6287 414 static void post_initialize();
stefank@5428 415
stefank@5428 416 static size_t capacity_until_GC();
ehelin@6796 417 static bool inc_capacity_until_GC(size_t v,
ehelin@6796 418 size_t* new_cap_until_GC = NULL,
ehelin@6796 419 size_t* old_cap_until_GC = NULL);
stefank@5428 420 static size_t dec_capacity_until_GC(size_t v);
coleenp@3602 421
coleenp@3602 422 static bool should_concurrent_collect() { return _should_concurrent_collect; }
coleenp@3602 423 static void set_should_concurrent_collect(bool v) {
coleenp@3602 424 _should_concurrent_collect = v;
coleenp@3602 425 }
coleenp@3602 426
coleenp@3602 427 // The amount to increase the high-water-mark (_capacity_until_GC)
stefank@5428 428 static size_t delta_capacity_until_GC(size_t bytes);
coleenp@3602 429
stefank@5428 430 // Tells if we have can expand metaspace without hitting set limits.
stefank@5428 431 static bool can_expand(size_t words, bool is_class);
stefank@5428 432
stefank@5428 433 // Returns amount that we can expand without hitting a GC,
stefank@5428 434 // measured in words.
stefank@5428 435 static size_t allowed_expansion();
coleenp@3602 436
coleenp@3602 437 // Calculate the new high-water mark at which to induce
coleenp@3602 438 // a GC.
coleenp@3602 439 static void compute_new_size();
coleenp@3602 440 };
coleenp@3602 441
coleenp@3602 442 #endif // SHARE_VM_MEMORY_METASPACE_HPP