Reader small image

You're reading from  Java Coding Problems - Second Edition

Product typeBook
Published inMar 2024
PublisherPackt
ISBN-139781837633944
Edition2nd Edition
Right arrow
Author (1)
Anghel Leonard
Anghel Leonard
author image
Anghel Leonard

Anghel Leonard is a Chief Technology Strategist and independent consultant with 20+ years of experience in the Java ecosystem. In daily work, he is focused on architecting and developing Java distributed applications that empower robust architectures, clean code, and high-performance. Also passionate about coaching, mentoring and technical leadership. He is the author of several books, videos and dozens of articles related to Java technologies.
Read more about Anghel Leonard

Right arrow

224. Observing and monitoring virtual threads

Observing and monitoring virtual threads can be done in several ways. First, we can use Java Flight Recorder (JFR) – we introduced this tool in Chapter 6, Problem 143.

Using JFR

Among its reach list of events, JFR can monitor and record the following events related to virtual threads:

  • jdk.VirtualThreadStart – this event is recorded when a virtual thread starts (by default, it is disabled)
  • jdk.VirtualThreadEnd – this event is recorded when a virtual thread ends (by default, it is disabled)
  • jdk.VirtualThreadPinned – this event is recorded when a virtual thread is parked while pinned (by default, it is enabled with a threshold of 20 ms)
  • jdk.VirtualThreadSubmitFailed – this event is recorded if a virtual thread cannot be started or unparked (by default, it is enabled)

You can find all the JFR events at https://sap.github.io/SapMachine/jfrevents/.

We start...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Java Coding Problems - Second Edition
Published in: Mar 2024Publisher: PacktISBN-13: 9781837633944

Author (1)

author image
Anghel Leonard

Anghel Leonard is a Chief Technology Strategist and independent consultant with 20+ years of experience in the Java ecosystem. In daily work, he is focused on architecting and developing Java distributed applications that empower robust architectures, clean code, and high-performance. Also passionate about coaching, mentoring and technical leadership. He is the author of several books, videos and dozens of articles related to Java technologies.
Read more about Anghel Leonard