diff src/share/vm/runtime/arguments.cpp @ 2095:36c186bcc085

6302804: Hotspot VM dies ungraceful death when C heap is exhausted in various places. Summary: enhance the error reporting mechanism to help user to fix the problem rather than making it look like a VM error. Reviewed-by: kvn, kamg
author coleenp
date Mon, 03 Jan 2011 14:09:11 -0500
parents ac637b7220d1
children 91fe28b03d6a 8f8dfba37802
line wrap: on
line diff
--- a/src/share/vm/runtime/arguments.cpp	Tue Dec 28 09:54:09 2010 -0500
+++ b/src/share/vm/runtime/arguments.cpp	Mon Jan 03 14:09:11 2011 -0500
@@ -2297,14 +2297,15 @@
     } else if (match_option(option, "-Xoss", &tail)) {
           // HotSpot does not have separate native and Java stacks, ignore silently for compatibility
     // -Xmaxjitcodesize
-    } else if (match_option(option, "-Xmaxjitcodesize", &tail)) {
+    } 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);
       if (errcode != arg_in_range) {
         jio_fprintf(defaultStream::error_stream(),
-                    "Invalid maximum code cache size: %s\n",
-                    option->optionString);
+                    "Invalid maximum code cache size: %s. Should be greater than InitialCodeCacheSize=%dK\n",
+                    option->optionString, InitialCodeCacheSize/K);
         describe_range_error(errcode);
         return JNI_EINVAL;
       }