7200092: Make NMT a bit friendlier to work with
authornloodin
Fri, 21 Sep 2012 10:56:28 +0200
changeset 13872 bbee2239e884
parent 13871 6f15b84496b0
child 13874 a93c03275528
7200092: Make NMT a bit friendlier to work with Reviewed-by: kvn, ysr, azeemj
hotspot/src/share/vm/services/memTracker.cpp
--- a/hotspot/src/share/vm/services/memTracker.cpp	Thu Sep 20 03:49:15 2012 -0700
+++ b/hotspot/src/share/vm/services/memTracker.cpp	Fri Sep 21 10:56:28 2012 +0200
@@ -71,8 +71,13 @@
   _tracking_level = NMT_off;
   if (strncmp(option_line, "=summary", 8) == 0) {
     _tracking_level = NMT_summary;
-  } else if (strncmp(option_line, "=detail", 8) == 0) {
+  } else if (strncmp(option_line, "=detail", 7) == 0) {
     _tracking_level = NMT_detail;
+  } else {
+    char msg[255];
+    //+1 to remove the '=' character
+    jio_snprintf(msg, 255, "Unknown option given to XX:NativeMemoryTracking: %s", option_line+1);
+    vm_exit_during_initialization(msg, NULL);
   }
 }