转载

使用FlameGraph分析JAVA应用性能

yum install perf -y
yum install gcc -y
yum install gcc-c++
yum install cmake -y
复制代码

ubuntu

apt install linux-tools-generic
apt install linux-tools-common
复制代码

FlameGraph

# 参考 http://www.brendangregg.com/FlameGraphs/cpuflamegraphs.html#Java
export JAVA_HOME=/root/jdk1.8.0_181
export PATH=$JAVA_HOME/bin:$PATH
git clone --depth=1 https://github.com/jrudolph/perf-map-agent
cd perf-map-agent
cmake .
make
bin/create-links-in /usr/bin

git clone https://github.com/brendangregg/FlameGraph.git
export FLAMEGRAPH_DIR=/root/git/FlameGraph
# jvm启动参数需要增加
-XX:+PreserveFramePointer

perf-java-flames 21322
复制代码
原文  https://juejin.im/post/5d207690e51d45775746b9a4
正文到此结束
Loading...