--- a/hotspot/src/share/vm/services/memTracker.cpp Fri May 24 09:35:10 2013 -0700
+++ b/hotspot/src/share/vm/services/memTracker.cpp Tue May 28 11:32:46 2013 -0400
@@ -34,6 +34,7 @@
#include "services/memReporter.hpp"
#include "services/memTracker.hpp"
#include "utilities/decoder.hpp"
+#include "utilities/defaultStream.hpp"
#include "utilities/globalDefinitions.hpp"
bool NMT_track_callsite = false;
@@ -77,7 +78,15 @@
if (strcmp(option_line, "=summary") == 0) {
_tracking_level = NMT_summary;
} else if (strcmp(option_line, "=detail") == 0) {
- _tracking_level = NMT_detail;
+ // detail relies on a stack-walking ability that may not
+ // be available depending on platform and/or compiler flags
+ if (PLATFORM_NMT_DETAIL_SUPPORTED) {
+ _tracking_level = NMT_detail;
+ } else {
+ jio_fprintf(defaultStream::error_stream(),
+ "NMT detail is not supported on this platform. Using NMT summary instead.");
+ _tracking_level = NMT_summary;
+ }
} else if (strcmp(option_line, "=off") != 0) {
vm_exit_during_initialization("Syntax error, expecting -XX:NativeMemoryTracking=[off|summary|detail]", NULL);
}