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

NMT: Remove VM.native_memory shutdown jcmd command option

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P4 P4
    • 17-pool
    • hotspot
    • None
    • behavioral
    • low
    • The command is very rarely used. Customers who have used this jcmd should remove uses of this command line option to jcmd. The compatibility risk is minimized somewhat by deprecating the option, not outright removing it (see CSR text).
    • add/remove/modify command line option
    • JDK

      Differences to original CSR:

      The original CSR was about removing the sub-option. That was fine for a head release.

      This CSR, aimed at a maintenance release, proposes to deprecate it instead:

      • jcmd would still accept the "shutdown" sub option and return 0 as exit code.
      • But jcmd should report "This option has been deprecated" instead of "NMT is shutting down"

      Summary

      Deprecate 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
      @@ -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");
      +    output()->print_cr("Shutdown sub command has been deprecated.");
         } else if (_statistics.value()) {
           if (check_detail_tracking_level(output())) {
             MemTracker::tuning_statistics(output());
      

            stuefe Thomas Stuefe
            zgu Zhengyu Gu
            Coleen Phillimore
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: