src/share/vm/runtime/arguments.cpp
Print this page
rev 4555 : Moved check: ReservedCodeCacheSize >= InitialCodeCacheSize to Arguments::check_vm_args_consistency()
As a result, the order in which the two arguments are passed is irrelevant.
@@ -2086,10 +2086,17 @@
#if INCLUDE_NMT
}
#endif
}
+ if (ReservedCodeCacheSize < InitialCodeCacheSize) {
+ jio_fprintf(defaultStream::error_stream(),
+ "Invalid maximum code cache size: %dK. Should be greater than InitialCodeCacheSize=%dK\n",
+ ReservedCodeCacheSize/K, InitialCodeCacheSize/K);
+ status = false;
+ }
+
return status;
}
bool Arguments::is_bad_option(const JavaVMOption* option, jboolean ignore,
const char* option_type) {
@@ -2438,16 +2445,14 @@
// HotSpot does not have separate native and Java stacks, ignore silently for compatibility
// -Xmaxjitcodesize
} else if (match_option(option, "-Xmaxjitcodesize", &tail) ||
match_option(option, "-XX:ReservedCodeCacheSize=", &tail)) {
julong long_ReservedCodeCacheSize = 0;
- ArgsRange errcode = parse_memory_size(tail, &long_ReservedCodeCacheSize,
- (size_t)InitialCodeCacheSize);
+ ArgsRange errcode = parse_memory_size(tail, &long_ReservedCodeCacheSize, 1);
if (errcode != arg_in_range) {
jio_fprintf(defaultStream::error_stream(),
- "Invalid maximum code cache size: %s. Should be greater than InitialCodeCacheSize=%dK\n",
- option->optionString, InitialCodeCacheSize/K);
+ "Invalid maximum code cache size: %s. Should be greater than 1K\n", option->optionString);
describe_range_error(errcode);
return JNI_EINVAL;
}
FLAG_SET_CMDLINE(uintx, ReservedCodeCacheSize, (uintx)long_ReservedCodeCacheSize);
// -green