OS Manuals

/usr/bin/asprof

A low overhead sampling profiler for Java

From async-profiler 4.6-r0 (os), captured 2026-11-05 by running asprof --help (exit 0). permalink

Usage: asprof [action] [options] <pid>
Actions:
  start               start profiling and return immediately
  resume              resume profiling without resetting collected data
  stop                stop profiling
  dump                dump collected data without stopping profiling session
  status              print profiling status
  metrics             print profiler metrics in Prometheus format
  list                list profiling events supported by the target JVM
  load                load agent library (jattach action)
  jcmd                run JVM diagnostic command (jattach action)
  collect             collect profile for the specified period of time
                      and then stop (default action)
Options:
  -e event            profiling event: cpu|alloc|nativemem|lock|cache-misses etc.
  -d duration         run profiling for <duration> seconds
  -f filename         file name or http(s) URL to submit profiles to
  -i interval         sampling interval in nanoseconds
  -j jstackdepth      maximum Java stack depth
  -t, --threads       profile different threads separately
  -s, --simple        simple class names instead of FQN
  -n, --norm          normalize names of hidden classes / lambdas
  -g, --sig           print method signatures
  -a, --ann           annotate Java methods
  -l, --lib           prepend library names
  --dot               dotted class names
  -o fmt              output format: flat|traces|collapsed|flamegraph|tree|jfr|otlp
  -I include          output only stack traces containing the specified pattern
  -X exclude          exclude stack traces with the specified pattern
  -L level            log level: debug|info|warn|error|none
  -F features         advanced stack trace features: mixed, vtable, comptask, pcaddr
  -v, --version       display version string

  --title string      FlameGraph title
  --minwidth pct      skip frames smaller than pct%
  --reverse           generate stack-reversed FlameGraph / Call tree (defaults to icicle graph)
  --inverted          toggles the layout for reversed stacktraces from icicle to flamegraph
                      and for default stacktraces from flamegraph to icicle

  --loop time         run profiler in a loop
  --alloc bytes       allocation profiling interval in bytes
  --tlab              use TLAB events for allocation profiling
  --live              build allocation profile from live objects only
  --nativemem bytes   native allocation profiling interval in bytes
  --nofree            do not collect free calls in native allocation profiling
  --trace method      Method to be instrumented with optional latency threshold
  --lock time         lock profiling threshold in nanoseconds
  --nativelock time   pthread mutex/rwlock profiling threshold in nanoseconds
  --wall interval     wall clock profiling interval
  --nobatch           legacy wall clock sampling without batch events
  --ithread pattern   in wall clock mode, profile only threads matching the name pattern
  --xthread pattern   in wall clock mode, skip threads matching the name pattern
  --proc interval     process sampling interval (default: 30s)
  --all               shorthand for enabling cpu, wall, alloc, live,
                      nativemem and lock profiling simultaneously
  --total             accumulate the total value (time, bytes, etc.)
  --all-user          only include user-mode events
  --sched             group threads by scheduling policy
  --cstack mode       how to traverse C stack: fp|dwarf|vm|no
  --signal num        use alternative signal for cpu or wall clock profiling
  --clock source      clock source for JFR timestamps: tsc|monotonic
  --begin function    begin profiling when function is executed
  --end function      end profiling when function is executed
  --ttsp              only time-to-safepoint profiling
  --nostop            do not stop profiling outside --begin/--end window
  --memlimit bytes    limit size of the stack trace storage
  --ratelimit limits  limit the number of JFR events emitted per second
  --jfropts opts      JFR recording options: mem
  --jfrsync config    synchronize profiler with JFR recording
  --libpath path      full path to libasyncProfiler.so in the container
  --fdtransfer        run separate fdtransfer process to serve perf requests
                      from the non-privileged target
  --target-cpu cpu    sample threads on a specific CPU (perf_events only, default: -1)

<pid> is a numeric process ID of the target JVM
      or 'jps' keyword to find running JVM automatically
      or the application name as it would appear in the jps tool

Example: asprof -d 30 -f profile.html 3456
         asprof start -i 1ms jps
         asprof stop -o flat jps
         asprof -d 5 -e alloc MyAppName
         asprof --all -f profile.jfr MyAppName
Options (54)
OptionDescriptionSource
-e eventprofiling event: cpu|alloc|nativemem|lock|cache-misses etc.help
-d durationrun profiling for <duration> secondshelp
-f filenamefile name or http(s) URL to submit profiles tohelp
-i intervalsampling interval in nanosecondshelp
-j jstackdepthmaximum Java stack depthhelp
-t, --threadsprofile different threads separatelyhelp
-s, --simplesimple class names instead of FQNhelp
-n, --normnormalize names of hidden classes / lambdashelp
-g, --sigprint method signatureshelp
-a, --annannotate Java methodshelp
-l, --libprepend library nameshelp
--dotdotted class nameshelp
-o fmtoutput format: flat|traces|collapsed|flamegraph|tree|jfr|otlphelp
-I includeoutput only stack traces containing the specified patternhelp
-X excludeexclude stack traces with the specified patternhelp
-L levellog level: debug|info|warn|error|nonehelp
-F featuresadvanced stack trace features: mixed, vtable, comptask, pcaddrhelp
-v, --versiondisplay version stringhelp
--title stringFlameGraph titlehelp
--minwidth pctskip frames smaller than pct%help
--reversegenerate stack-reversed FlameGraph / Call tree (defaults to icicle graph)help
--invertedtoggles the layout for reversed stacktraces from icicle to flamegraph and for default stacktraces from flamegraph to iciclehelp
--loop timerun profiler in a loophelp
--alloc bytesallocation profiling interval in byteshelp
--tlabuse TLAB events for allocation profilinghelp
--livebuild allocation profile from live objects onlyhelp
--nativemem bytesnative allocation profiling interval in byteshelp
--nofreedo not collect free calls in native allocation profilinghelp
--trace methodMethod to be instrumented with optional latency thresholdhelp
--lock timelock profiling threshold in nanosecondshelp
--nativelock timepthread mutex/rwlock profiling threshold in nanosecondshelp
--wall intervalwall clock profiling intervalhelp
--nobatchlegacy wall clock sampling without batch eventshelp
--ithread patternin wall clock mode, profile only threads matching the name patternhelp
--xthread patternin wall clock mode, skip threads matching the name patternhelp
--proc intervalprocess sampling interval (default: 30s)help
--allshorthand for enabling cpu, wall, alloc, live, nativemem and lock profiling simultaneouslyhelp
--totalaccumulate the total value (time, bytes, etc.)help
--all-useronly include user-mode eventshelp
--schedgroup threads by scheduling policyhelp
--cstack modehow to traverse C stack: fp|dwarf|vm|nohelp
--signal numuse alternative signal for cpu or wall clock profilinghelp
--clock sourceclock source for JFR timestamps: tsc|monotonichelp
--begin functionbegin profiling when function is executedhelp
--end functionend profiling when function is executedhelp
--ttsponly time-to-safepoint profilinghelp
--nostopdo not stop profiling outside --begin/--end windowhelp
--memlimit byteslimit size of the stack trace storagehelp
--ratelimit limitslimit the number of JFR events emitted per secondhelp
--jfropts optsJFR recording options: memhelp
--jfrsync configsynchronize profiler with JFR recordinghelp
--libpath pathfull path to libasyncProfiler.so in the containerhelp
--fdtransferrun separate fdtransfer process to serve perf requests from the non-privileged targethelp
--target-cpu cpusample threads on a specific CPU (perf_events only, default: -1)help

Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.