MCPcopy Create free account
hub / github.com/async-profiler/async-profiler

github.com/async-profiler/async-profiler @v4.4

Chat with this repo
repository ↗ · DeepWiki ↗ · release v4.4 ↗ · + Follow
2,678 symbols 6,193 edges 310 files 138 documented · 5% updated 2d agonightly · 2026-07-08★ 9,07749 open issues

Browse by type

Functions 2,212 Types & classes 466
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Async-profiler

This project is a low overhead sampling profiler for Java that does not suffer from the Safepoint bias problem. It features HotSpot-specific API to collect stack traces and to track memory allocations. The profiler works with OpenJDK and other Java runtimes based on the HotSpot JVM.

Unlike traditional Java profilers, async-profiler monitors non-Java threads (e.g., GC and JIT compiler threads) and shows native and kernel frames in stack traces.

What can be profiled:

  • CPU time
  • Allocations in Java Heap
  • Native memory allocations and leaks
  • Contended locks
  • Hardware and software performance counters like cache misses, page faults, context switches
  • and more.

See our 3 hours playlist to learn about more features.

Download

Stable release: 4.3

Nightly builds

The most recent binaries corresponding to the latest successful commit in master.

For a build corresponding to one of the previous commits, go to Nightly Builds, click the desired build and scroll down to the artifacts section. These binaries are kept for 30 days.

Quick start

In a typical use case, profiling a Java application is just a matter of a running asprof with a PID of a running Java process.

$ asprof -d 30 -f flamegraph.html <PID>

The above command translates to: run profiler for 30 seconds and save results to flamegraph.html as an interactive Flame Graph that can be viewed in a browser.

FlameGraph

Find more details in the Getting started guide.

Building

Build status

Build Status

Minimum requirements

  • make
  • GCC 7.5.0+ or Clang 7.0.0+
  • Static version of libstdc++ (e.g. on Amazon Linux 2023: yum install libstdc++-static)
  • JDK 11+

How to build

Make sure gcc, g++ and java are available on the PATH. Navigate to the root directory with async-profiler sources and run make. async-profiler launcher will be available at build/bin/asprof.

Other Makefile targets:

  • make test - run unit and integration tests;
  • make release - package async-profiler binaries as .tar.gz (Linux) or .zip (macOS).

Supported platforms

Officially maintained builds Other available ports
Linux x64, arm64 x86, arm32, ppc64le, riscv64, loongarch64
macOS x64, arm64

Documentation

Basic usage

Profiler output

Advanced usage

Troubleshooting

For known issues faced while running async-profiler and their detailed troubleshooting, please refer here.

Extension points exported contracts — how you extend this code

Core symbols most depended-on inside this repo

Shape

Method 1,912
Class 424
Function 300
Enum 34
Interface 8

Languages

C++60%
Java37%
C3%

Modules by API surface

src/vmStructs.h99 symbols
src/flightRecorder.cpp95 symbols
src/rustDemangle.cpp76 symbols
src/profiler.cpp70 symbols
src/instrument.cpp61 symbols
src/os_linux.cpp59 symbols
src/symbols_linux.cpp54 symbols
src/os_macos.cpp53 symbols
src/converter/one/jfr/JfrReader.java52 symbols
src/perfEvents_linux.cpp46 symbols
src/converter/one/heatmap/Heatmap.java42 symbols
src/converter/one/convert/JfrToOtlp.java31 symbols

For agents

$ claude mcp add async-profiler \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page