# HG changeset patch # User stuefe # Date 1572609701 -3600 # Node ID 24152dbf6c78612f67077a514fdc490f3448707f # Parent e18d2d9d15154b7151b07c1b7803abb99fdbaefd Tune boot loader chunk sizes diff -r e18d2d9d1515 -r 24152dbf6c78 src/hotspot/share/memory/metaspace/chunkAllocSequence.cpp --- a/src/hotspot/share/memory/metaspace/chunkAllocSequence.cpp Fri Nov 01 11:09:18 2019 +0100 +++ b/src/hotspot/share/memory/metaspace/chunkAllocSequence.cpp Fri Nov 01 13:01:41 2019 +0100 @@ -98,6 +98,21 @@ // .. repeat last }; +// Boot class loader: give it large chunks: beyond commit granule size +// (typically 64K) the costs for large chunks largely diminishes since +// they are committed on the fly. +static const chklvl_t g_sequ_boot_non_class[] = { + chklvl::CHUNK_LEVEL_4M, + chklvl::CHUNK_LEVEL_1M + // .. repeat last +}; + +static const chklvl_t g_sequ_boot_class[] = { + chklvl::CHUNK_LEVEL_1M, + chklvl::CHUNK_LEVEL_256K + // .. repeat last +}; + #define DEFINE_CLASS_FOR_ARRAY(what) \ static ConstantChunkAllocSequence g_chunk_alloc_sequence_##what (g_sequ_##what, sizeof(g_sequ_##what)/sizeof(chklvl_t)); @@ -107,8 +122,10 @@ DEFINE_CLASS_FOR_ARRAY(anon_class) DEFINE_CLASS_FOR_ARRAY(refl_non_class) DEFINE_CLASS_FOR_ARRAY(refl_class) +DEFINE_CLASS_FOR_ARRAY(boot_non_class) +DEFINE_CLASS_FOR_ARRAY(boot_class) - +/* class BootLoaderChunkAllocSequence : public ChunkAllocSequence { // For now, this mirrors what the old code did @@ -157,7 +174,7 @@ static BootLoaderChunkAllocSequence g_chunk_alloc_sequence_boot_non_class(false); static BootLoaderChunkAllocSequence g_chunk_alloc_sequence_boot_class(true); - +*/ const ChunkAllocSequence* ChunkAllocSequence::alloc_sequence_by_space_type(MetaspaceType space_type, bool is_class) {