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

jcmd GC.run should not be blocked by DisableExplicitGC

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 10
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
      svc
    • Resolved In Build:
      b23

      Description

      jcmd GC.run to invoke GC fails if -XX:+DisableExplicitGC is set: this seems like a mistake as it is obstructive for a live app that needs a GC, and was started with -XX:+DisableExplicitGC.

      DisableExplicitGC to protect from Java code calling System.gc frequently makes sense, but if I can attach and run a dcmd, I should have permission to inspect and maintain the JVM, including invoking a GC. (This is as the user who owns the process and can kill it off.)

      The current behaviour (checking DisableExplicitGC in SystemGCDCmd::execute) came in with
      JDK-8004095: Add support for JMX interface to Diagnostic Framework and Commands

      ..which is in jdk8 onwards. This bug is saying we should move back to the JDK7 behaviour where the GC.run was not blocked by DisableExplicitGC.

        Attachments

          Activity

            People

            • Assignee:
              kevinw Kevin Walls
              Reporter:
              kevinw Kevin Walls
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: