Hot/Cold Flame Graph is an visualization which combines both on-CPU and off-CPU flame graphs.
This is an example of a Hot/Cold Flame Graph generated by async-profiler.
-
Launch containers
docker-compose up -d --build
-
Exec async-profiler to generate .jfr file in demo container
# external shell curl http://localhost:9090/demo # (optional) use ab command instead of curl
docker-compose exec demo bash /var/lib/async-profiler/profiler.sh -e wall,alloc,lock -d 60 -t -i 1ms -o jfr -f "demo.jfr" $(pgrep -nx java)
-e wall
option must be used to sample regardless of thread state (on-CPU or off-CPU).-t
option should be used to avoid confusing off-CPU and on-CPU comparisons. -
Convert .jfr to .html
java -cp converter.jar jfr2flame --hotcold demo.jfr demo.html java -cp converter.jar jfr2flame --hotcold --threads demo.jfr demo_threads.html