jdeps is a tool that can be used to analyze the dependencies of a jar file and generate a list of the modules that are needed to run the application.
jlink is a tool that can be used to create a custom runtime image that contains only the modules that are needed to run your application.
Tag: Java
Java eBPF profiling
When the kernel samples a stack trace, it is a list of instruction pointers in the virtual address space of the relevant process. Symbolization is the task of translating those virtual addresses into human readable symbols, e.g. translating address
0x1234abcdinto symbolfoo().Symbolizers for compiled languages that are not JITed (e.g. C++, Golang) work by finding the debug symbol section in natively compiled binaries and libraries. However this is not available for Java byte code, since the code is not statically mapped into the application’s virtual address space. Thus, our original symbolizer could not make sense out of a Java stack-traces (except for parts that are explicitly in the JVM, but these are not usually of interest to application developers).
In brief, we use the Java Virtual Machine Tool Interface — the “JVMTI” — to interact with the JVM running the target Java application. Based on the open source Java “perf map agent”, we wrote our own JVMTI agent that listens to the JVMTI callbacks for
https://blog.px.dev/cpu-profiling-java/CompiledMethodLoadandDynamicCodeGenerated2. Thus, our JVMTI agent writes each Java symbol and its corresponding address range into a symbol file, and by reading this file, the Pixie data collection process (the Pixie Edge Module or “pem”) symbolizes Java stack-traces.