Generate a flame graph to find which part of your Java app is consuming the most CPU time.
Detect memory allocation hotspots in a running Java service without restarting the process.
Measure lock contention to find where threads are blocking each other in a multithreaded app.
Profile native code paths alongside JVM bytecode to get a complete picture of performance.
Requires a running JVM process to attach to, pre-built binaries available for Linux and macOS on x64 and arm64.
Async-profiler is a tool for measuring the performance of Java programs. When a Java application is running slowly or using more memory than expected, a profiler helps you find out where the bottleneck is. Async-profiler attaches to a running Java process and periodically samples what the program is doing, then produces a report showing which parts of the code are taking up the most time or memory. One of the things that sets this profiler apart from others is how it collects data. Many older Java profilers have a known accuracy problem where they can only take measurements at certain safe points in the program, which means they miss what is happening in between and produce misleading results. Async-profiler avoids this by using lower-level operating system interfaces to take samples at any point, giving a more accurate picture of where time is actually spent. The tool can measure several different things: how much CPU time the program uses, where memory is being allocated, native memory allocations and leaks, lock contention (when parts of the program are waiting for each other), and hardware-level events like cache misses or page faults. Using it is straightforward for the common case. You run a single command with the process ID of your Java application, tell it how many seconds to run, and it saves an interactive flame graph as an HTML file you can open in a browser. A flame graph is a visual chart where each bar represents a function call and the width shows how much time was spent there, making it easy to spot slow areas at a glance. Async-profiler works on Linux and macOS, supporting both x64 and arm64 processors. Pre-built binaries are available for download, so you do not need to compile it yourself unless you want to. It works with OpenJDK and other Java runtimes built on the HotSpot JVM.
← async-profiler on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.