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

{ClassLoading,Memory}MXBean::isVerbose methods are inconsistent with their setVerbose methods

XMLWordPrintable

    • behavioral
    • minimal
    • Hide
      There are no bug reports involving these methods, nor can I find anything on the web discussing their use in any way. Whilst we can expect the statistics provided by these MXBeans to be used, there is no indication of any use of the verbosity methods. So while in theory we can express scenarios where this change in behaviour is quite evident, in practice we do not expect there will be any impact.
      Show
      There are no bug reports involving these methods, nor can I find anything on the web discussing their use in any way. Whilst we can expect the statistics provided by these MXBeans to be used, there is no indication of any use of the verbosity methods. So while in theory we can express scenarios where this change in behaviour is quite evident, in practice we do not expect there will be any impact.
    • Java API
    • SE

      Summary

      Update the behavior of the isVerbose methods so that they reflect the actions of the setVerbose methods.

      Problem

      The ClassLoadingMXBean::setVerbose(boolean enabled) method will set class+load* logging on log output stdout to level info if enabled is true, and to level off otherwise. In contrast, the isVerbose method will check if exactly class+load logging is enabled at the info level on any log output. This can result in counter-intuitive behavior when logging class+load=info to a file via the command-line, as it causes isVerbose to return true, even after a call to setVerbose(false) has been made.

      A similar problem exists for the MemoryMXBean::isVerbose method.

      Solution

      To remedy this problem the isVerbose method implementations are modified to report only on what the logging settings for log output stdout have been set to, as would be modified by the setVerbose methods.

      Specification

      There are no changes to any actual specifications as the specifications involved refer very generically to "the verbose output for the class loading system" and "the verbose output for the memory system", and it is implementation specific as to what that actually means.

      With the proposed changes the new behavior is as follows:

      • ClassLoadingMXBean::isVerbose will return true only if class+load* logging (note the wildcard use) has been enabled at the info level (or above) on the stdout log output.

      • MemoryMXBean::isVerbose will return true only if gc logging has been enabled at the info level (or above) on the stdout log output.

            dholmes David Holmes
            lmesnik Leonid Mesnik
            Daniel Daugherty, Mark Reinhold
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: