Upgrade the bundled async-profiler to v4.5 to fix long JVM pauses when loading/attaching the profiler (async-profiler issue 1406)
- I have searched the issues and confirmed this is not a duplicate (no issue in this repo asks to track async-profiler v4.5).
Environment
arthas-boot.jar/as.shversion: 4.3.5 (everything from 4.2.0 onward bundles async-profiler v4.4)- Target JVM version: any (JDK 8+ affected; the pause scales with the number of loaded libraries and symbol-cache temperature)
- OS: Linux
Background: Arthas bundles async-profiler v4.4, which has a known attach-freeze bug fixed in v4.5
Arthas has bundled async-profiler v4.4 (tag v4.4, commit 86adc160) since 4.2.0 (PR #3199, 2026-05). The latest release 4.3.5 and master still ship v4.4 — verified via the attribution in core/src/main/java/one/profiler/package-info.java.
Upstream async-profiler v4.4 and earlier has a confirmed bug that was fixed in v4.5:
- async-profiler/async-profiler#1406: Long time-to-safepoint pause when attaching asprof
Mechanism: when the agent library is loaded via
dlopen(), the global objectLateInitializerfully resolves all shared libraries during construction (walking/proc/self/maps). This runs on a thread that cannot reach a safepoint in time, so the JVM's time-to-safepoint is stretched by however long resolution takes — measured at several seconds of whole-JVM pause on cold caches / many libraries, all before any sampling starts. Also async-profiler/async-profiler#1756: on JVMs with more than 2048 native libraries, the full scan can exhaust the limit before reaching libjvm, making attach fail (JVM does not support Tool Interface).
Upstream fix:
- PR async-profiler/async-profiler#1769 "Parse only essential libraries at load time" (merged 2026-07-13): at load time only
libjvm/libj9*/libazsys(Zing) / async-profiler itself are parsed, sodlopenreturns in milliseconds; the rest is deferred toProfiler::start. - Shipped in v4.5 (released 2026-07-20); the release notes list
#1406and#1756under Bug fixes.
How it surfaces in Arthas
Arthas does not load the .so at attach time — it loads libAsyncProfiler.so on the first profiler start. So in Arthas this bug shows up as: the profiler start command stalling and the target application briefly "freezing", more noticeable in containers with many libraries / cold caches. This matches the feel of other "profiler stuck / no response" issues in this repo, which were hard to root-cause because the cause lives in the upstream library's load-time symbol parsing.
Request
- Upgrade the bundled async-profiler from v4.4 to v4.5 (or explain why / when it will be tracked);
- If an upgrade is not imminent, provide a workaround (e.g. allow replacing the .so shipped in the distribution, or document the risk).
References
- Upstream issues: #1406 (attach freeze / time-to-safepoint pause), #1756 (attach fails with many native libraries)
- Fix PR: #1769 Parse only essential libraries at load time
- Fix release: async-profiler v4.5 (2026-07-20)
- Previous Arthas upgrade precedent: IS #3186 / PR #3199 (to 4.4, issue-driven, ~2.5 weeks)
Source: alibaba/arthas