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

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Unresolved
    • Priority: P4
    • tbd
    • Affects Version/s: None
    • Component/s: core-svc
    • None

      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.

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

              Created:
              Updated: