Async-profiler: Help finding a suitable JDK

Created on 30 Mar 2021  Â·  8Comments  Â·  Source: jvm-profiling-tools/async-profiler

We'd like to run the profiler inside Docker using Java 15 but we're having trouble knowing which JDK is the correct one to use in order to have debug symbols. We chose one but are getting this error every few seconds:
WARNING: Install JVM debug symbols to improve profile accuracy

question

Most helpful comment

Liberica JDK will be a good choice. Their lite builds are really small, yet fully functional. Liberica JDK is profiler-ready out of the box. They also provide docker images for the popular environments.

Zulu OpenJDK is another great option. They offer a wide range of packages and docker images for all occasions.

All 8 comments

Liberica JDK will be a good choice. Their lite builds are really small, yet fully functional. Liberica JDK is profiler-ready out of the box. They also provide docker images for the popular environments.

Zulu OpenJDK is another great option. They offer a wide range of packages and docker images for all occasions.

@mjaggard is this an issue with JDK 11 builds also?

I created my own image for testing purposes: https://github.com/petrbouda/openjdk-x-dbg-asyncprofiler

I installed locally using SDKMAN Liberica and Zulu JDK, and both failed on the test for Debug Symbols (at least the test mentioned in README file)

Setting java 16.0.0-librca as default.
➜  ~ gdb $JAVA_HOME/lib/server/libjvm.so -ex 'info address UseG1GC'             [21/03/31| 9:15PM]
GNU gdb (Ubuntu 9.2-0ubuntu1~20.04) 9.2
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
.
Find the GDB manual and other documentation resources online at:
    .

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /home/pbouda/.sdkman/candidates/java/current/lib/server/libjvm.so...
(No debugging symbols found in /home/pbouda/.sdkman/candidates/java/current/lib/server/libjvm.so)
Symbol "UseG1GC" is at 0x15bdc44 in a file compiled without debugging.

@petrbouda Symbol "UseG1GC" is at 0x15bdc44 message says that the symbol was found, and correctly resolved to the address 0x15bdc44.

I agree, gdb message sounds confusing. The thing is that "debuginfo" includes more than just "symbols", and async-profiler needs only symbols from .symtab section, not the full debuginfo.

.symtab can be either embedded in the binary (like with Liberica and Zulu), or come in a separate package containing the full debuginfo (e.g. openjdk-15-dbg). IMO, the former is preferred, as it adds just a couple of megabytes and works instantly without extra packages. -dbg packages are often huge (hundreds of megabytes), as they include much more than just symbols.

Then it makes sense to me because I was able to see JVM frames and wasn't sure what I was missing. Thanks a lot for your explanation! :+1:

@mjaggard What was the reason for you choosing the slim builds? They are intended to be very small (so we strip them, unlike the non-slim builds) so the expectation was likely that people picking them up want the smallest image possible for their deployments, irrespective of being able to monitor/debug it. Have you tried with the normal AdoptOpenJDK docker images as they shouldn't be stripped - you shouldn't necessarily have to go to another provider to be able to use the profiler ;-) ?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ceeaspb picture ceeaspb  Â·  5Comments

nobeh picture nobeh  Â·  5Comments

shipilev picture shipilev  Â·  4Comments

ceeaspb picture ceeaspb  Â·  6Comments

stsypanov picture stsypanov  Â·  5Comments