Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The current prototype has rudimentary support for reporting when a thread is pinned, say when a virtual thread parks while owning a monitor or with a native frame on the stack. This reporting is enabled by running if with the system property jdk.tracePinnedThreads is specified  specified to the java launcher.

Running with -Djdk.tracePinnedThreads (or -Djdk.tracePinnedThreads=full) will print a complete stack trace of the a virtual thread . Native when parking pins its carrier thread. The reason, be it native frames, synchronized frames, or frames with synchronized blocks will be highlighted in the output.

...

    jcmd <pid> Thread.dump_to_json_file <file>

The JSON file has two arrays. There is one array for the threads that includes the identifier, name, and stack trace of each thread. The second array has the thread executors and the identifiers of all threads started by the executor.