--- a/hotspot/src/share/vm/runtime/arguments.cpp Tue Jan 20 10:22:43 2015 -0800
+++ b/hotspot/src/share/vm/runtime/arguments.cpp Tue Jan 20 15:24:58 2015 -0800
@@ -1152,7 +1152,8 @@
}
// Increase the code cache size - tiered compiles a lot more.
if (FLAG_IS_DEFAULT(ReservedCodeCacheSize)) {
- FLAG_SET_ERGO(uintx, ReservedCodeCacheSize, ReservedCodeCacheSize * 5);
+ FLAG_SET_ERGO(uintx, ReservedCodeCacheSize,
+ MIN2(CODE_CACHE_DEFAULT_LIMIT, ReservedCodeCacheSize * 5));
}
// Enable SegmentedCodeCache if TieredCompilation is enabled and ReservedCodeCacheSize >= 240M
if (FLAG_IS_DEFAULT(SegmentedCodeCache) && ReservedCodeCacheSize >= 240*M) {
@@ -2458,11 +2459,11 @@
"Invalid ReservedCodeCacheSize=%dK. Must be at least %uK.\n", ReservedCodeCacheSize/K,
min_code_cache_size/K);
status = false;
- } else if (ReservedCodeCacheSize > 2*G) {
- // Code cache size larger than MAXINT is not supported.
+ } else if (ReservedCodeCacheSize > CODE_CACHE_SIZE_LIMIT) {
+ // Code cache size larger than CODE_CACHE_SIZE_LIMIT is not supported.
jio_fprintf(defaultStream::error_stream(),
"Invalid ReservedCodeCacheSize=%dM. Must be at most %uM.\n", ReservedCodeCacheSize/M,
- (2*G)/M);
+ CODE_CACHE_SIZE_LIMIT/M);
status = false;
} else if (NonNMethodCodeHeapSize < min_code_cache_size){
jio_fprintf(defaultStream::error_stream(),