背景

用jmap打dump文件经常遇到如下异常,打不出来,哥今天告拆大家一个终极解决方法,嘘,不要告拆别人。。

Attaching to core -F from executable 421442, please wait...
Error attaching to core file: cannot open binary file
sun.jvm.hotspot.debugger.DebuggerException: cannot open binary file
at sun.jvm.hotspot.debugger.linux.LinuxDebuggerLocal.attach0(Native Method)
at sun.jvm.hotspot.debugger.linux.LinuxDebuggerLocal.attach(LinuxDebuggerLocal.java:286)
。。。

解决方法

在root用户下使用su -m user  -c " command " 搞定。如下:

[root@host11]# su -m yarn -c "jmap -dump:format=b,file=ll.bin 421442"
Dumping heap to /tmp/hsperfdata_yarn/ll.bin ...
Heap dump file created

Jhat打开dump

jhat -J-mx4g D:\soft\DumpViewer_bkill.com\ll2.bin

eclipse打开dump

1)安装mat

打开Eclipse - >help - > Eclipse Marketplace,搜mat

点install, 同意协议后,点击Finish就开始安装MAT了

2)选中使用

安装完成后提示重启Eclipse,重启后打开window - > open perspective,看到Memory Analysis证明安装成功,选中memory analisys - OK

3)打开dump

File -> open heap dump,选择你准备好的dump文件

tips:

eclips发生out of memory,在

C:\Java\eclipse\java-2018-12\eclipse目录下有个 eclips.ini文件,调整

-Xms1024m
   -Xmx5024m

最新文章

  1. MSSQL MERGE语法
  2. HTML:图片热点 网页划区 表单
  3. Ubuntu下类似于Total Commander的两个工具
  4. 学习使用:before和:after伪元素
  5. 将一副图片编译进uboot
  6. 解决方法:java.lang.NoSuchMethodError: javax.persistence.Table.indexes()[Ljavax/persistence/Index;
  7. Iso8601 日期格式
  8. cocos2dx游戏项目总结(持续更新)
  9. U - stl 的 优先队列 Ⅰ
  10. poj1163 dp入门
  11. Angularjs快速入门(二)
  12. weblogic AND jboss 反序列化漏洞
  13. 物联网RFID技术之应用ETC系统
  14. 使用IIS应用程序初始化来保持ASP.NET应用程序的活动
  15. 一、OpenStack环境准备及共享组件安装
  16. @Autowired注入报错
  17. helm安装redis+Sentinel集群搭建
  18. asp.net mvc easyui tree
  19. [原]Jenkins(二)---jenkins之Git+maven+jdk+tomcat
  20. linux driver ------ 三星公司uboot模式下更改分区(EMMC)大小fdisk命令 ------ iTOP4412 开发板烧写

热门文章

  1. linux第四章读书笔记
  2. Android实践项目汇报
  3. 关于spring框架工作原理的初解
  4. openwrt编译系统生成ubi镜像的各变量解析
  5. Flask 5 模板1
  6. UVa 10917 林中漫步
  7. TCGA系列--GDCRNATools
  8. redis的过期策略以及内存淘汰机制
  9. Eclipse.导出可执行的jar(包含第3方jar)
  10. HDU1754 I hate it_线段树(入门级别)