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

Remove the option onjcmd from the jdwp agent

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P4 P4
    • 24
    • core-svc
    • None
    • behavioral
    • minimal
    • Hide
      This will remove a JDWP agent option and its corresponding VM.start_java_debugging jcmd. While we consider it obsolete, we also assume that this was rarely used outside of SAP. It has been hidden from the help output virtually since its inception in 2019 (see https://bugs.openjdk.org/browse/JDK-8227078) and the only mentioning of the option on the internet are my own blog posts.
      Show
      This will remove a JDWP agent option and its corresponding VM.start_java_debugging jcmd. While we consider it obsolete, we also assume that this was rarely used outside of SAP. It has been hidden from the help output virtually since its inception in 2019 (see https://bugs.openjdk.org/browse/JDK-8227078) and the only mentioning of the option on the internet are my own blog posts.
    • add/remove/modify command line option
    • JDK

      Summary

      Remove the onjcmd option from the jdwp agent, because it is considered obsolete and unused.

      Problem

      The onjcmd mechanism was introduced through JDK-8214892 "Delayed starting of debugging via jcmd". It brought the possibility to start the JVM with debugging capabilities enabled, but without an open port to attach to until triggered, and with less performance penalty compared to starting the VM with fully armed debugging. So it offered a form of "On demand debugging".

      However, it is not needed anymore, as the performance issue has been fixed, and the networking/open port topic can easily be handled by infrastructure. Furthermore, the option is rarely used due to being hidden via JDK-8227078. So, we should remove the feature along with its coding to reduce complexity.

      Solution

      Remove the onjcmd option from the JDWP agent and eliminate the corresponding VM.start_java_debugging command in the JVM. This will clean up the agent code and remove obsolete functionality that is no longer needed or used.

      Specification

      All the changes mentioned in the solution are also removed, plus the OnJcmdTest is removed, and TestAgentEvent is fixed. The diff can be found in the PR: https://github.com/openjdk/jdk/pull/21387.

            jbechberger Johannes Bechberger
            clanger Christoph Langer
            Alan Bateman, Chris Plummer, Christoph Langer
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: