Proposed under the OpenJDK community, the Skogsluft project aims to elevate Java Flight Recorder’s (JFR) profiling capabilities, enhancing diagnostic and profiling features for running Java applications. This initiative targets three major improvements to refine the profiling experience:
- Advanced Stackwalker: Skogsluft introduces an enhanced stackwalker capable of navigating mixed Java and native stacks seamlessly. This improvement ensures a more coherent view of stack traces, especially in scenarios where Java and native code are intricately woven together. Developers can expect a more comprehensive understanding of application execution dynamics.
- Flexible CPU Sampler Scheduler: The project proposes a flexible CPU sampler scheduler designed to provide more accurate and adaptable CPU sampling. For Linux, the scheduler leverages perf_event_open or timer_create, while macOS utilizes itimer. In instances where other operating systems are in use, the system gracefully falls back to standard execution samples. This enhancement promises enhanced precision in CPU profiling across various environments.
- Labeling Support for JFR: Skogsluft introduces labeling support for JFR, enabling developers to set per-thread key-value labels that seamlessly integrate into JFR events. This labeling capability enriches profiling data, offering a more nuanced context for targeted debugging and in-depth analysis. This addition ensures that developers can gather more specific insights into the behavior of individual threads during the profiling process.
Furthermore, the Skogsluft project envisions extending the JFR API to facilitate easy and flexible labeling of threads, ensuring consistent capture of labels in profiling data. The initiative is set to commence with a clone of the planned JDK 23 mainline release, scheduled for September, and will continue to align with subsequent mainline releases. This forward-looking approach ensures that Java developers can anticipate ongoing enhancements in profiling capabilities to streamline their diagnostic and optimization efforts.