Hsdis
Hsdis是什么
下載Hsdis
git clone https://github.com/liuzhengyang/hsdis
cd hsdis
tar -zxvf binutils-2.26.tar.gz
make BINUTILS=binutils-2.26 ARCH=amd64
配置Hsdis
sudo cp build/macosx-amd64/hsdis-amd64.dylib /Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/jre/lib/server/
運行Hsdis
在java運行命令加入-XX:+UnlockDiagnosticVMOptions -XX:+PrintAssembly
命令,例如,對com.io.lzy.VolatileTest
類進行操作
在IDEA中配置
JITWatch
JITWatch是什么
下載JITWatch
git clone https://github.com/AdoptOpenJDK/jitwatch.git
使用JITWatch
- 啟動
cd jitwatch
./launchUI.sh
-
選擇open log,點擊start
-
點擊sanbox,選擇open,選擇要分析的java文件,點擊run