Towards Runtime-Aware Observability for Java Virtual Threads
Wenjie Ding
Key points
From the paper's conclusion- We also show that, of the two update strategies OTEP 4947 permits, only in-place rewriting guarded by the record's valid flag is sound for readers that cache the record's address, as lifecycle-event readers do.
Abstract
OS-level observability tools join application requests to kernel events through the OS thread ID, assuming that a unit of work occupies one OS thread until it completes. Java virtual threads break this assumption: many virtual threads are multiplexed onto a few carrier threads, so a stable thread ID hides a changing unit of work, and the join fails silently. Existing virtual-thread-aware channels republish context or identity on every mount and unmount, and the JVMTI-based one pays this cost for the lifetime of the JVM, whether or not an observer is attached. We bind a 64-byte off-heap trace buffer to each virtual thread, at a fixed address for its lifetime, and publish the address to eBPF consumers through four USDT probes in a patched OpenJDK; a re-implemented JVMTI channel over the same buffer serves as a controlled comparison. The four-probe design attributed all 768 test markers correctly on both the content and the identity plane, while the naive two-probe design silently misattributes trace context. With no consumer attached, publication costs at most about 33 ns per transition; the remaining dormant cost is buffer allocation, about 0.37 microseconds per virtual thread, which is negligible on transition-heavy workloads but nearly doubles the cost of a creation-only microbenchmark. The JVMTI channel costs about 20% on transition-heavy workloads and about 1.8 microseconds per virtual thread on the creation-only one. We also show that, of the two update strategies OTEP 4947 permits, only in-place rewriting guarded by the record's valid flag is sound for readers that cache the record's address, as lifecycle-event readers do.
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- Xtrace: High-Fidelity GPU Intra-Kernel Tracing via Binary-Level Instruction SplicingarXiv · 2026
- Pyriscope: Precise and Low-Overhead Python Control Flow Tracing via Sparse Hardware-Based EventsProceedings of the ACM on Programming Languages · 2026
- Optimization and Evaluation of Container-Based EtherCAT Communication in Virtual PLCsIEEE Transactions on Industrial Electronics · 2026
- Warpline: Binary-Level Tracing and Unified Evidence for Agentic GPU Kernel OptimizationarXiv · 2026
- AgentLoupe: Kernel-Resident Semantic Causal Labels for AI Agent ObservabilityarXiv · 2026
- Interrupt-Aware Static Detection of Deadlocks in Rust Operating SystemsarXiv · 2026