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

Thread dump issues

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Unresolved
    • P3
    • tbd
    • repo-loom
    • core-svc
    • None

    Description

      The following are issues with the new thread dump (jcmd Thread.dump_to_file) that should be examined.

      1. The thread dump does not include virtual threads created directly with the Thread API. Should the default setting of jdk.trackAllThreads be changed to true to avoid surprises?

      2. jcmd Thread.dump_to_file requires a file to be specified. Some users may want the output generated to stdout, possible by specifying the file as "-" but it limits the output to about 16k so will appear truncated when there are huge number of threads. Should this be re-visited to default to stdout if a file is not specified? Could an OutputStream could be created that is backed by the pipe connection to the tool so that the output doesn't need to be buffered off-heap?

      3. jcmd Thread.dump_to_file triggers the Attach Listener thread in the target VM to generate the thread dump. The Attach Listener is a daemon thread so does not prevent the VM from exiting. Should this command prevent the VM from exiting? The issue dates back to JDK 6 but may not have been noticed because other Java commands executed by the Attach Listener are short lived.

      4. The JSON format should be documented somewhere. It should also have a version element to allow the format to be updated going forward.

      Attachments

        Issue Links

          Activity

            People

              alanb Alan Bateman
              alanb Alan Bateman
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated: