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

Include thread counts in safepoint logging

XMLWordPrintable

    • b13

      As follow-up for JDK-8350313, I believe it would be convenient to print the number of runnable/total threads that participated in safepoint. The number of threads is important to understand the safepoint behavior: whether safepoint machinery was overloaded with syncing up / waking up too many runnable threads, whether there are lots of threads to begin with, etc.

      This information is already available in `SafepointTracing::{_nof_threads, _nof_running}` fields. -Xlog:safepoint+stats can be used to reach it, but we see services enabling -Xlog:safepoint only for several reasons: the logging is more accurate, happen near the actual VM operation and can clearly be atttributed to it.

      So, it would be great to printing thread counts in -Xlog:safepoint, something like this:

      [3.694s][info][safepoint] Safepoint "SerialCollectForAllocation", Time since last: 555 ns, Reaching safepoint: 111 ns, At safepoint: 222 ns, Leaving safepoint: 111 ns, Total: 444 ns, Threads: 56 runnable, 1024 total

            xpeng Xiaolong Peng
            shade Aleksey Shipilev
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: