--- old/src/hotspot/share/opto/c2compiler.cpp 2018-10-26 12:37:08.918399655 +0200 +++ new/src/hotspot/share/opto/c2compiler.cpp 2018-10-26 12:37:08.734470451 +0200 @@ -605,6 +605,8 @@ } int C2Compiler::initial_code_buffer_size() { - assert(SegmentedCodeCache, "Should be only used with a segmented code cache"); - return Compile::MAX_inst_size + Compile::MAX_locs_size + initial_const_capacity; + // See Compile::init_scratch_buffer_blob + int locs_size = sizeof(relocInfo) * Compile::MAX_locs_size; + int slop = 2 * CodeSection::end_slop(); // space between sections + return Compile::MAX_inst_size + Compile::MAX_stubs_size + initial_const_capacity + slop + locs_size; }