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

ThreadInfo::toString arbitrarilly limits the number of stack frames printed to 8

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Unresolved
    • P4
    • tbd
    • None
    • core-svc
    • None

    Description

      The following code:

        Arrays.stream(ManagementFactory.getThreadMXBean()
                              .dumpAllThreads(true, true))
                              .map(ThreadInfo::toString)
                              .forEach(out::println);

      will only print 8 frames for each thread:
      https://github.com/openjdk/jdk/blob/0be1f3e1b0f4ac515a86e9f8e1999dc090b1bdd2/src/java.management/share/classes/java/lang/management/ThreadInfo.java#L665

      It would be good if that arbitrary limit could be removed, allowing to print all frames recorded in the ThreadInfo, or if a method was provided to allow to specify a different limit.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              dfuchs Daniel Fuchs
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: