原文:https://www.jianshu.com/p/0e5d8db8ed5e

错误场景

今天使用jmap -heap命令查看堆的详细信息报错。

[root@instance-2gak1pfv debuginfo]# java -version
openjdk version "1.8.0_191"
OpenJDK Runtime Environment (build 1.8.0_191-b12)
OpenJDK 64-Bit Server VM (build 25.191-b12, mixed mode) [root@instance-2gak1pfv debuginfo]# jps -l
110386 org.apache.zookeeper.server.quorum.QuorumPeerMain
40565 sun.tools.jps.Jps
[root@instance-2gak1pfv debuginfo]# jmap -heap 110386
Attaching to process ID 110386, please wait...
Debugger attached successfully.
Server compiler detected.
JVM version is 25.191-b12 using thread-local object allocation.
Mark Sweep Compact GC Heap Configuration:
MinHeapFreeRatio = 40
MaxHeapFreeRatio = 70
MaxHeapSize = 255852544 (244.0MB)
NewSize = 5570560 (5.3125MB)
MaxNewSize = 85262336 (81.3125MB)
OldSize = 11206656 (10.6875MB)
NewRatio = 2
SurvivorRatio = 8
MetaspaceSize = 21807104 (20.796875MB)
CompressedClassSpaceSize = 1073741824 (1024.0MB)
MaxMetaspaceSize = 17592186044415 MB
G1HeapRegionSize = 0 (0.0MB) Heap Usage:
Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at sun.tools.jmap.JMap.runTool(JMap.java:201)
at sun.tools.jmap.JMap.main(JMap.java:130)
Caused by: java.lang.RuntimeException: unknown CollectedHeap type : class sun.jvm.hotspot.gc_interface.CollectedHeap
at sun.jvm.hotspot.tools.HeapSummary.run(HeapSummary.java:157)
at sun.jvm.hotspot.tools.Tool.startInternal(Tool.java:260)
at sun.jvm.hotspot.tools.Tool.start(Tool.java:223)
at sun.jvm.hotspot.tools.Tool.execute(Tool.java:118)
at sun.jvm.hotspot.tools.HeapSummary.main(HeapSummary.java:50)
... 6 more

解决办法:
安装debuginfo,去网站http://debuginfo.centos.org/7/x86_64里面找匹配当前的openjdk的版本,小版本号也要匹配上。然后使用wget命令下载

wget http://debuginfo.centos.org/7/x86_64/java-1.8.0-openjdk-debuginfo-1.8.0.191.b12-1.el7_6.x86_64.rpm

使用rpm命令安装

rpm -ivh java-1.8.0-openjdk-debuginfo-1.8.0.191.b12-1.el7_6.x86_64.rpm

然后查看是否安装了debuginfo

[root@izuf6ea4rfo45y44oj74jhz logs]# rpm -qa|grep debuginfo
java-1.8.0-openjdk-debuginfo-1.8.0.191.b12-1.el7_6.x86_64

执行jmap -heap命令查看堆详细信息

[root@izuf6ea4rfo45y44oj74jhz logs]# jmap -heap 1421
Attaching to process ID 1421, please wait...
Debugger attached successfully.
Server compiler detected.
JVM version is 25.191-b12 using thread-local object allocation.
Mark Sweep Compact GC Heap Configuration:
MinHeapFreeRatio = 40
MaxHeapFreeRatio = 70
MaxHeapSize = 482344960 (460.0MB)
NewSize = 10485760 (10.0MB)
MaxNewSize = 160759808 (153.3125MB)
OldSize = 20971520 (20.0MB)
NewRatio = 2
SurvivorRatio = 8
MetaspaceSize = 21807104 (20.796875MB)
CompressedClassSpaceSize = 1073741824 (1024.0MB)
MaxMetaspaceSize = 17592186044415 MB
G1HeapRegionSize = 0 (0.0MB) Heap Usage:
New Generation (Eden + 1 Survivor Space):
capacity = 48758784 (46.5MB)
used = 42933176 (40.94426727294922MB)
free = 5825608 (5.555732727050781MB)
88.05218768376176% used
Eden Space:
capacity = 43384832 (41.375MB)
used = 42933176 (40.94426727294922MB)
free = 451656 (0.43073272705078125MB)
98.95895413401624% used
From Space:
capacity = 5373952 (5.125MB)
used = 0 (0.0MB)
free = 5373952 (5.125MB)
0.0% used
To Space:
capacity = 5373952 (5.125MB)
used = 0 (0.0MB)
free = 5373952 (5.125MB)
0.0% used
tenured generation:
capacity = 108146688 (103.13671875MB)
used = 64887344 (61.88139343261719MB)
free = 43259344 (41.25532531738281MB)
59.99938158069159% used 21962 interned Strings occupying 2552376 bytes.

jmap错误:unknown CollectedHeap type : class sun.jvm.hotspot.gc_interface.CollectedHeap的更多相关文章

  1. 【JVM】【linux】linux上执行jmap命令查看JVM内存使用情况,报错:sun.jvm.hotspot.debugger.NoSuchSymbolException: Could not find symbol "gHotSpotVMTypes" in any of the known library name

    运行命令: jmap -heap 报错如下: Attaching to process ID , please wait... sun.jvm.hotspot.debugger.NoSuchSymbo ...

  2. Spring错误之org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean named 'bookService' is expected to be of type 'pw.fengya.tx.BookService' but was actually of type 'com.sun.proxy.$Proxy1

    org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'cas ...

  3. mint17.3挂载u盘出现错误:mount:unknown filesystem type 'exfat'

    mint17.3挂载u盘出现错误:mount:unknown filesystem type 'exfat' 安装exfat-fuse: sudo apt-get install exfat-fuse

  4. 在linux终端执行clear或top命令时出现:'xterm' unknown terminal type的错误

    例如: [root@localhost phpmyadmin]# clear 'xterm': unknown terminal type. 解决办法: 1.临时办法,下次启动失效,需要重新执行 ex ...

  5. 运行top时,会报unknown terminal type错误

    问题: 在板子上执行top时总是提示'vt102': unknown terminal type. 执行了export TERM=xterm,还是不管用 解决: 执行export,方向没有设置TERM ...

  6. Spring 动态代理 之 but was actually of type 'com.sun.proxy.$Proxy14 Exception

    今天在写Spring的引介代理的时候,报了一个错: Exception in thread "main" org.springframework.beans.factory.Bea ...

  7. [virsh] error: unknown OS type hvm解决办法

    今天在linux服务器上编译安装升级了下qemu,升级命令如下: root@ubuntu:/opt/qemu-# ./configure --prefix=/usr/local/ --target-l ...

  8. 'vt100': unknown terminal type.

    在Linux终端执行clear或top命令时出现:vt100: unknown terminal type的错误 1.临时办法,下次启动失效,需要重新执行 执行以下命令 $ printenv | gr ...

  9. 在Linux终端执行clear或top命令时出现:'xterm': unknown terminal type

    在Linux终端执行clear或top命令时出现:'xterm': unknown terminal type的错误. 例如: [root@localhost phpmyadmin]# clear ' ...

随机推荐

  1. easyMock本地化搭建

    为了更快捷的定义接口且mock接口数据,减轻前后端对接时的工作量,可以使用easyMock平台. 1. 使用 git clone 下载easy-mock项目 https://github.com/ea ...

  2. css特效之旋转音乐播放器

    本次需要用到的知识点有: transform setInerval 怎么添加背景音乐我会在下一篇介绍 https://www.cnblogs.com/zouwangblog/p/11138734.ht ...

  3. Ansible之playbook的使用

    playbook介绍 一. 为什么引入playbook 我们完成一个任务,例如安装部署一个httpd服务,我们需要多个模块(一个模块也可以称之为task)提供功能来完成.而playbook就是组织多个 ...

  4. 图、流程图、ER图怎么画及常见画图工具(流程图文章汇总)

    流程图基本符号 首先要记住图中1.2.3.4.6这几种符号. 图片摘自网络 流程图基本概念及入门 简易流程图 流程图简介(基本符号与绘制工具) 你可能学了假流程图,三步教会你绘制大厂流程图 使用流程图 ...

  5. npm和yarn设置镜像源

    npm 设置为淘宝源 npm config set registry https://registry.npm.taobao.org 使用nrm管理 nrm: npm registry manage ...

  6. 【免费视频】使用VS Code开发ASP.NET Core WebAPI应用程序

    1.使用VS Code开发ASP.NET Core WebAPI应用程序 1.使用Visual Studio Code开发Asp.Net Core基础入门实战 毕竟从.net过度过来的我们已经习惯了使 ...

  7. xilinx SDK开发 GPIO使用API总结

    t_v GPIO常用函数 1.XGpio_Config *XGpio_LookupConfig(u16 DeviceId) 功能:根据输入设备ID查找该设备. 输入:设备ID. 输出:若找到该设备ID ...

  8. Linux内核文档翻译——kobject.txt

    ==================================================================== Everything you never wanted to ...

  9. JVM一些问题

    1. 类的实例化顺序,比如父类静态数据,构造函数,字段,子类静态数据,构造函数,字段,他们的执行顺序 答:先静态.先父后子. 先静态:父静态 > 子静态 优先级:父类 > 子类 静态代码块 ...

  10. kubernetes 1.15 有哪些让人眼前一亮的新特性?

    原文链接:kubernetes 1.15 有哪些让人眼前一亮的新特性? 2019 年 6 月 20 日,Kubernetes 重磅发布了 1.15 版本,不过笔者忙到现在才有空认真来看一下到底更新了哪 ...