diff options
author | anoll <none@none> | 2013-07-09 11:48:05 +0200 |
---|---|---|
committer | anoll <none@none> | 2013-07-09 11:48:05 +0200 |
commit | 427f5b0191e47adf62e386517da5d84cb062e3c3 (patch) | |
tree | 6e91c71d487ac62a1670e2a1a3906543482d869c /src/share/vm | |
parent | b50d838315659275aecf19b60319fc68ddb8b266 (diff) |
8015635: Crash when specifying very large code cache size
Summary: Limit the size of the code cache to at most 2G when arguments are checked; added regression test
Reviewed-by: kvn, twisti
Diffstat (limited to 'src/share/vm')
-rw-r--r-- | src/share/vm/runtime/arguments.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/share/vm/runtime/arguments.cpp b/src/share/vm/runtime/arguments.cpp index c52959d69..7f3e09c27 100644 --- a/src/share/vm/runtime/arguments.cpp +++ b/src/share/vm/runtime/arguments.cpp @@ -1855,8 +1855,13 @@ bool Arguments::check_gc_consistency() { "please refer to the release notes for the combinations " "allowed\n"); status = false; + } else if (ReservedCodeCacheSize > 2*G) { + // Code cache size larger than MAXINT is not supported. + jio_fprintf(defaultStream::error_stream(), + "Invalid ReservedCodeCacheSize=%dM. Must be at most %uM.\n", ReservedCodeCacheSize/M, + (2*G)/M); + status = false; } - return status; } @@ -2239,8 +2244,13 @@ bool Arguments::check_vm_args_consistency() { "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. + jio_fprintf(defaultStream::error_stream(), + "Invalid ReservedCodeCacheSize=%dM. Must be at most %uM.\n", ReservedCodeCacheSize/M, + (2*G)/M); + status = false; } - return status; } |