Skip to content
Permalink
Browse files
8277946: NMT: Deprecate and remove VM.native_memory shutdown jcmd com…
…mand option

Reviewed-by: stuefe, shade, dholmes
  • Loading branch information
zhengyu123 committed Dec 1, 2021
1 parent 37ff7f3 commit abaa073bcbdb202658c8a97401ffb098d71e0f16
Showing 5 changed files with 2 additions and 133 deletions.
@@ -50,9 +50,6 @@ NMTDCmd::NMTDCmd(outputStream* output,
"comparison against previous baseline, which shows the memory " \
"allocation activities at different callsites.",
"BOOLEAN", false, "false"),
_shutdown("shutdown", "request runtime to shutdown itself and free the " \
"memory used by runtime.",
"BOOLEAN", false, "false"),
_statistics("statistics", "print tracker statistics for tuning purpose.", \
"BOOLEAN", false, "false"),
_scale("scale", "Memory usage in which scale, KB, MB or GB",
@@ -62,7 +59,6 @@ NMTDCmd::NMTDCmd(outputStream* output,
_dcmdparser.add_dcmd_option(&_baseline);
_dcmdparser.add_dcmd_option(&_summary_diff);
_dcmdparser.add_dcmd_option(&_detail_diff);
_dcmdparser.add_dcmd_option(&_shutdown);
_dcmdparser.add_dcmd_option(&_statistics);
_dcmdparser.add_dcmd_option(&_scale);
}
@@ -79,9 +75,6 @@ void NMTDCmd::execute(DCmdSource source, TRAPS) {
if (MemTracker::tracking_level() == NMT_off) {
output()->print_cr("Native memory tracking is not enabled");
return;
} else if (MemTracker::tracking_level() == NMT_minimal) {
output()->print_cr("Native memory tracking has been shutdown");
return;
}

const char* scale_value = _scale.value();
@@ -97,12 +90,11 @@ void NMTDCmd::execute(DCmdSource source, TRAPS) {
if (_baseline.is_set() && _baseline.value()) { ++nopt; }
if (_summary_diff.is_set() && _summary_diff.value()) { ++nopt; }
if (_detail_diff.is_set() && _detail_diff.value()) { ++nopt; }
if (_shutdown.is_set() && _shutdown.value()) { ++nopt; }
if (_statistics.is_set() && _statistics.value()) { ++nopt; }

if (nopt > 1) {
output()->print_cr("At most one of the following option can be specified: " \
"summary, detail, metadata, baseline, summary.diff, detail.diff, shutdown");
"summary, detail, metadata, baseline, summary.diff, detail.diff");
return;
} else if (nopt == 0) {
if (_summary.is_set()) {
@@ -147,9 +139,6 @@ void NMTDCmd::execute(DCmdSource source, TRAPS) {
} else {
output()->print_cr("No detail baseline for comparison");
}
} else if (_shutdown.value()) {
MemTracker::shutdown();
output()->print_cr("Native memory tracking has been turned off");
} else if (_statistics.value()) {
if (check_detail_tracking_level(output())) {
MemTracker::tuning_statistics(output());
@@ -42,7 +42,6 @@ class NMTDCmd: public DCmdWithParser {
DCmdArgument<bool> _baseline;
DCmdArgument<bool> _summary_diff;
DCmdArgument<bool> _detail_diff;
DCmdArgument<bool> _shutdown;
DCmdArgument<bool> _statistics;
DCmdArgument<char*> _scale;

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -69,7 +69,6 @@ public static void main(String args[]) throws Exception {
jcmdCommand("summary.diff");
jcmdCommand("detail.diff");
jcmdCommand("scale=GB");
jcmdCommand("shutdown");
}

// Helper method for invoking different jcmd calls, all should fail with the same message saying NMT is not enabled

This file was deleted.

This file was deleted.

1 comment on commit abaa073

@openjdk-notifier
Copy link

@openjdk-notifier openjdk-notifier bot commented on abaa073 Dec 1, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.