jdk自带jmap查看Tomcat内存里类的情况出错
很奇怪, 项目的老年代的内存很大,就算满了,也是会释放一点点.所以想分析一下情况.首先,JDK和JRE的版本肯定一直的,-version看过了
然后一开始想最好能够生产heapdump文件.命令jmap -F -dump:format=b,file=d:\temp.hprof 7644
但是报错
Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at sun.tools.jmap.JMap.runTool(JMap.java:179)
at sun.tools.jmap.JMap.main(JMap.java:110)
Caused by: sun.jvm.hotspot.debugger.DebuggerException: Windbg Error: ReadVirtual failed!
at sun.jvm.hotspot.debugger.windbg.WindbgDebuggerLocal.readBytesFromProcess0(Native Method)
at sun.jvm.hotspot.debugger.windbg.WindbgDebuggerLocal.readBytesFromProcess(WindbgDebuggerLocal.java:485)
at sun.jvm.hotspot.debugger.DebuggerBase$Fetcher.fetchPage(DebuggerBase.java:76)
然后无耐,折中看内存类的构成 .命令 jmap -F -histo 7644.继续报错(报错内容一样)
Debugger attached successfully.
Server compiler detected.
JVM version is 20.6-b01
Iterating over heap. This may take a while...
Finding object size using Printezis bits and skipping over...
Exception in thread "main" java.lang.reflect.InvocationTargetException
但是我用jmap -heap 7644 查看heap是没有问题的.能够得到内存的使用情况信息.
所以请问有谁能够帮忙解决一下. 分数不多,请见谅