问题描述
很奇怪,项目的老年代的内存很大,就算满了,也是会释放一点点.所以想分析一下情况.首先,JDK和JRE的版本肯定一直的,-version看过了然后一开始想最好能够生产heapdump文件.命令jmap-F-dump:format=b,file=d:temp.hprof7644但是报错Exceptioninthread"main"java.lang.reflect.InvocationTargetExceptionatsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)atjava.lang.reflect.Method.invoke(Method.java:597)atsun.tools.jmap.JMap.runTool(JMap.java:179)atsun.tools.jmap.JMap.main(JMap.java:110)Causedby:sun.jvm.hotspot.debugger.DebuggerException:WindbgError:ReadVirtualfailed!atsun.jvm.hotspot.debugger.windbg.WindbgDebuggerLocal.readBytesFromProcess0(NativeMethod)atsun.jvm.hotspot.debugger.windbg.WindbgDebuggerLocal.readBytesFromProcess(WindbgDebuggerLocal.java:485)atsun.jvm.hotspot.debugger.DebuggerBase$Fetcher.fetchPage(DebuggerBase.java:76)然后无耐,折中看内存类的构成.命令jmap-F-histo7644.继续报错(报错内容一样)Debuggerattachedsuccessfully.Servercompilerdetected.JVMversionis20.6-b01Iteratingoverheap.Thismaytakeawhile...FindingobjectsizeusingPrintezisbitsandskippingover...Exceptioninthread"main"java.lang.reflect.InvocationTargetException但是我用jmap-heap7644查看heap是没有问题的.能够得到内存的使用情况信息.所以请问有谁能够帮忙解决一下.分数不多,请见谅
解决方案
解决方案二:
有人能指导一下嘛?????谢谢~~~~~~~~~~~~~!!!!!!!!!!!!!!!!!
解决方案三:
你tomcat和你现在jmap用的不是同一个jdk么?
解决方案四:
C:ProgramFilesJavajdk1.6.0_31bin>"C:ProgramFilesJavajdk1.6.0_31binjava"-versionjavaversion"1.6.0_31"Java(TM)SERuntimeEnvironment(build1.6.0_31-b05)JavaHotSpot(TM)64-BitServerVM(build20.6-b01,mixedmode)C:ProgramFilesJavajdk1.6.0_31bin>"E:jre6_x64binjava"-versionjavaversion"1.6.0_31"Java(TM)SERuntimeEnvironment(build1.6.0_31-b05)JavaHotSpot(TM)64-BitServerVM(build20.6-b01,mixedmode)我看过,他们是一样的.而我用jmap-heap7644也是没有报错的