`

jvm运行期打印汇编信息

    博客分类:
  • jvm
阅读更多

        如果只在jvm参数中加入-XX:+PrintAssembly参数,运行报错:

Improperly specified VM option 'PrintAssembly'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

         同时加上-XX:+UnlockDiagnosticVMOptions则可以打印编译信息,并且这个参数必须放在PrintAssembly前面才行。不过MacOSX上加了之后又遇到了新的错误:

VM warning: PrintAssembly is enabled; turning on DebugNonSafepoints to gain additional output
Could not load hsdis-amd64.dylib; library not loadable; PrintAssembly is disabled

         按照这里下载hsdis-am64.dylib,放到你自己的目录下,如/xxx/yyy/zzz/,并chmod 设置当前用户可执行,然后在~/.bash_profile加上一行:

#这里只能设置到目录一级,不能设置到dylib文件
export LD_LIBRARY_PATH=/xxx/yyy/zzz/

         注销重新登陆,重新运行程序,汇编信息就打印出来了。

        enjoy it!

分享到:
评论
7 楼 yueyemaitian 2014-12-10  
stevenjeff 写道
http://ssw.jku.at/dcevm/binaries/,除了这个

没用过啦啦啦
6 楼 stevenjeff 2014-12-09  
http://ssw.jku.at/dcevm/binaries/,除了这个
5 楼 stevenjeff 2014-12-09  
请教你一个问题,有没有办法在运行状态下,改了方法参数列表,或者添加新类,不用重启就能debug的插件
4 楼 stevenjeff 2014-12-09  
stevenjeff 写道
zhangfangrui,

3 楼 stevenjeff 2014-12-09  
张方锐,
2 楼 yueyemaitian 2014-12-07  
stevenjeff 写道
你大爷的,我累个去

你哪个?
1 楼 stevenjeff 2014-12-04  
你大爷的,我累个去

相关推荐

Global site tag (gtag.js) - Google Analytics