Operations 2 min read

Using eBPF to Capture Complete Java Call Stacks from OpenJDK 8 JVM without Agent

The team successfully employed eBPF dynamic tracing to obtain full Java call‑stack traces from any point in an OpenJDK 8 JVM process with microsecond‑level overhead, without requiring any JVM agents, bytecode injection, or code modifications, making it suitable for production environments.

Cognitive Technology Team
Cognitive Technology Team
Cognitive Technology Team
Using eBPF to Capture Complete Java Call Stacks from OpenJDK 8 JVM without Agent

Our team has recently used eBPF‑based dynamic tracing to capture complete Java call‑stack traces from an OpenJDK 8 JVM process at any arbitrary point in time, with precision down to the Java source line.

No cooperation from the JVM is needed; the method does not rely on any JVM agent, bytecode injection, or machine‑code injection. The target process is accessed in a read‑only manner only, and the approach works for both interpreted and JIT‑compiled Java bytecode. The overhead is on the order of a few hundred microseconds, making it suitable for online production environments.

The Java call‑stack retrieval leverages existing C++ code inside the JVM, ensuring correctness. This C++ code is compiled by our Y++ and Ylang compilers into eBPF bytecode programs or other tracing tools, simplifying the workflow.

Future work includes generating various types of flame graphs, extracting method‑frame parameters and local variable values, and extending support to additional OpenJDK major versions such as 11.

JavaObservabilityPerformance MonitoringeBPFOpenJDKJVM tracingLow overhead
Cognitive Technology Team
Written by

Cognitive Technology Team

Cognitive Technology Team regularly delivers the latest IT news, original content, programming tutorials and experience sharing, with daily perks awaiting you.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.