--- old/src/share/vm/runtime/arguments.cpp 2014-02-04 16:00:32.074625771 +0100 +++ new/src/share/vm/runtime/arguments.cpp 2014-02-04 16:00:31.930625774 +0100 @@ -1128,6 +1128,15 @@ vm_exit_during_initialization( "Incompatible compilation policy selected", NULL); } + if (FLAG_IS_DEFAULT(CodeCacheSegmentSize) && FLAG_IS_DEFAULT(ReservedCodeCacheSize)) { + // There is enough code cache available. Increasing CodeCacheSegmentSize results + // in less memory fragmentation (and therefore a shorter freelist in the code heap.) + // Testing shows a reduction of the freelist length by several factors compared to + // using the default CodeCacheSegmentSize. A larger CodeCacheSegmentSize increases + // the memory consumption (due to possibly unused memory at the end of an nmethod) + // by a couple of percent only. + FLAG_SET_DEFAULT(CodeCacheSegmentSize, CodeCacheSegmentSize * 2); + } // Increase the code cache size - tiered compiles a lot more. if (FLAG_IS_DEFAULT(ReservedCodeCacheSize)) { FLAG_SET_DEFAULT(ReservedCodeCacheSize, ReservedCodeCacheSize * 5); @@ -2342,6 +2351,8 @@ status &= verify_interval(NmethodSweepFraction, 1, ReservedCodeCacheSize/K, "NmethodSweepFraction"); status &= verify_interval(NmethodSweepActivity, 0, 2000, "NmethodSweepActivity"); + status &= verify_interval(CodeCacheMinBlockLength, 1, 100, "CodeCacheMinBlockLength"); + status &= verify_interval(CodeCacheSegmentSize, 1, 1024, "CodeCacheSegmentSize"); return status; }