hotspot/src/share/vm/prims/jvm.cpp
changeset 13197 b552dfeffb3c
parent 12231 6a9cfc59a18a
child 13286 b8b0898d5f3a
--- a/hotspot/src/share/vm/prims/jvm.cpp	Mon Jul 02 13:11:28 2012 -0400
+++ b/hotspot/src/share/vm/prims/jvm.cpp	Tue Jul 03 01:41:29 2012 -0400
@@ -345,9 +345,13 @@
   // Do this after setting user properties to prevent people
   // from setting the value with a -D option, as requested.
   {
-    char as_chars[256];
-    jio_snprintf(as_chars, sizeof(as_chars), INTX_FORMAT, MaxDirectMemorySize);
-    PUTPROP(props, "sun.nio.MaxDirectMemorySize", as_chars);
+    if (FLAG_IS_DEFAULT(MaxDirectMemorySize)) {
+      PUTPROP(props, "sun.nio.MaxDirectMemorySize", "-1");
+    } else {
+      char as_chars[256];
+      jio_snprintf(as_chars, sizeof(as_chars), UINTX_FORMAT, MaxDirectMemorySize);
+      PUTPROP(props, "sun.nio.MaxDirectMemorySize", as_chars);
+    }
   }
 
   // JVM monitoring and management support