【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.NoSuchSymbolException: Could not find symbol "gHotSpotVMTypes" in any of the known library names (libjvm.so, libjvm_g.so, gamma_g)
at sun.jvm.hotspot.HotSpotTypeDataBase.lookupInProcess(HotSpotTypeDataBase.java:)
at sun.jvm.hotspot.HotSpotTypeDataBase.readVMTypes(HotSpotTypeDataBase.java:)
at sun.jvm.hotspot.HotSpotTypeDataBase.<init>(HotSpotTypeDataBase.java:)
at sun.jvm.hotspot.bugspot.BugSpotAgent.setupVM(BugSpotAgent.java:)
at sun.jvm.hotspot.bugspot.BugSpotAgent.go(BugSpotAgent.java:)
at sun.jvm.hotspot.bugspot.BugSpotAgent.attach(BugSpotAgent.java:)
at sun.jvm.hotspot.tools.Tool.start(Tool.java:)
at sun.jvm.hotspot.tools.HeapSummary.main(HeapSummary.java:)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:)
at java.lang.reflect.Method.invoke(Method.java:)
at sun.tools.jmap.JMap.runTool(JMap.java:)
at sun.tools.jmap.JMap.main(JMap.java:)
Debugger attached successfully.
sun.jvm.hotspot.tools.HeapSummary requires a java VM process/core!

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

报错原因:

  根据错误提示,可以看出来,需要一个java jvm的核心进程。

  明明PID就是我java进程的PID,进程编号呀。

错误原因:

  PID不是你要查看的JAVA进程的PID,注意区分你到底要查看那个JVM进程。

解决方法:

  查看java进程的PID

ps -ef | grep java

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

  现在自己查看一下,就可以发现

  6709是另一个位置的java进程。

  19570才是 我们当前想要查看的JVM进程。

  因为自己安装的java路径在/mnt/apps/soft/java路径 。配置的环境变量也是这个路径下的JDK.

  所以运行jmap指定错误的PID就导致了开始的错误。

  现在修改jmap指定的PID

jmap -heap 

运行成功:

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

Attaching to process ID , please wait...
Debugger attached successfully.
Server compiler detected.
JVM version is 24.80-b11 using thread-local object allocation.
Parallel GC with thread(s) Heap Configuration:
MinHeapFreeRatio =
MaxHeapFreeRatio =
MaxHeapSize = (.0MB)
NewSize = (.25MB)
MaxNewSize = MB
OldSize = (.1875MB)
NewRatio =
SurvivorRatio =
PermSize = (.75MB)
MaxPermSize = (.0MB)
G1HeapRegionSize = (.0MB) Heap Usage:
PS Young Generation
Eden Space:
capacity = (.0MB)
used = (.844123840332MB)
free = (.155876159668MB)
44.17879830305825% used
From Space:
capacity = (.5MB)
used = (.4843902587890625MB)
free = (.01560974121094MB)
0.7395271126550572% used
To Space:
capacity = (.0MB)
used = (.0MB)
free = (.0MB)
0.0% used
PS Old Generation
capacity = (.0MB)
used = (.53690338134766MB)
free = (.46309661865234MB)
53.88256201997471% used
PS Perm Generation
capacity = (.0MB)
used = (.81534576416016MB)
free = (.184654235839844MB)
87.57968995629287% used interned Strings occupying bytes.
上一篇:sql,取得当前系统时间,算时间区间


下一篇:[LeetCode] Find Right Interval 找右区间