Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8277947

NMT: Remove VM.native_memory shutdown jcmd command option

    XMLWordPrintable

    Details

    • Type: CSR
    • Status: Closed
    • Priority: P4
    • Resolution: Approved
    • Fix Version/s: 18
    • Component/s: hotspot
    • Labels:
      None
    • Subcomponent:
    • Compatibility Kind:
      behavioral
    • Compatibility Risk:
      minimal
    • Compatibility Risk Description:
      The command is rarely used. For customers who have used this jcmd should remove uses of this command line option to jcmd
    • Interface Kind:
      add/remove/modify command line option
    • Scope:
      JDK

      Description

      Summary

      Deprecate and remove NMT shutdown jcmd command option

      Problem

      The functionality to shutdown NMT is a remnant of its first implementation, which could consume an excessive amount of memory for tracking itself. This is no longer a problem in the current implementation. Since the shutdown ability causes unnecessary complexity, we will remove it.

      The jcmd VM.native_memory provides the shutdown sub-option as a user-facing frontend of NMT shutdown. It had been rarely used and should be removed as well.

      Solution

      Deprecate and remove the shutdownsub-option of the VM.native_memory jcmd.

      Specification

      Remove shutdown jcmd command.

      
      diff --git a/src/hotspot/share/services/nmtDCmd.cpp b/src/hotspot/share/services/nmtDCmd.cpp
      index e89dd2c56e7..dd8eb17c298 100644
      --- a/src/hotspot/share/services/nmtDCmd.cpp
      +++ b/src/hotspot/share/services/nmtDCmd.cpp
      @@ -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());
      diff --git a/src/hotspot/share/services/nmtDCmd.hpp b/src/hotspot/share/services/nmtDCmd.hpp
      index 1ea19735cdc..52c61d34c0c 100644
      --- a/src/hotspot/share/services/nmtDCmd.hpp
      +++ b/src/hotspot/share/services/nmtDCmd.hpp
      @@ -42,7 +42,6 @@ class NMTDCmd: public DCmdWithParser {
         DCmdArgument  _baseline;
         DCmdArgument  _summary_diff;
         DCmdArgument  _detail_diff;
      -  DCmdArgument  _shutdown;
         DCmdArgument  _statistics;
         DCmdArgument _scale;
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              zgu Zhengyu Gu
              Reporter:
              zgu Zhengyu Gu
              Reviewed By:
              Coleen Phillimore, Thomas Stuefe
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: