#3266·arthas

Upgrade the bundled async-profiler to v4.5 to fix long JVM pauses when loading/attaching the profiler (async-profiler issue 1406)

Author: zhumengzhuCreated Sep 8, 2026Updated Sep 8, 2026
  • 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.sh version: 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 object LateInitializer fully 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, so dlopen returns in milliseconds; the rest is deferred to Profiler::start.
  • Shipped in v4.5 (released 2026-07-20); the release notes list #1406 and #1756 under 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

  1. Upgrade the bundled async-profiler from v4.4 to v4.5 (or explain why / when it will be tracked);
  2. If an upgrade is not imminent, provide a workaround (e.g. allow replacing the .so shipped in the distribution, or document the risk).

References