在“内存不足"之后,在哪里可以找到堆转储. [英] Where to find the heap dump after an "Out Of Memory"

查看:85
本文介绍了在“内存不足"之后,在哪里可以找到堆转储.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用ASANT运行指向NARS.jar文件的xml文件.

I'm using ASANT to run a xml file which points to a NARS.jar file.

我正在获取"java.lang.OutOfMemoryError:Java堆空间",并且我正在对此进行研究.

I'm getting "java.lang.OutOfMemoryError: Java heap space" and i'm researching around this.

所以我发现我需要设置"-XX:+ HeapDumpOnOutOfMemoryError"来创建要分析的转储文件.

So i have found that i need to set "-XX:+HeapDumpOnOutOfMemoryError", to create a dump file to analyze.

我编辑了ASANT.bat,并在ANT_OPTS中添加了"-XX:+ HeapDumpOnOutOfMemoryError":

I edited ASANT.bat and added the "-XX:+HeapDumpOnOutOfMemoryError" to ANT_OPTS:

set ANT_OPTS= "-XX:+HeapDumpOnOutOfMemoryError" "-Dos.name=Windows_NT" "-Djava.library.path=%AS_INSTALL%\lib;%AS_ICU_LIB%;%AS_NSS%" "-Dcom.sun.aas.installRoot=%AS_INSTALL%" "-Dcom.sun.aas.instanceRoot=%AS_INSTALL%" "-Dcom.sun.aas.instanceName=server" "-Dcom.sun.aas.configRoot=%AS_CONFIG%" "-Dcom.sun.aas.processLauncher=SE" "-Dderby.root=%AS_DERBY_INSTALL%"  

但是我似乎找不到任何转储文件. 找到转储时,将使用Eclipse Memory Analyzer进行分析.

But i can't seem to find any dump file. I will use the Eclipse Memory Analyzer to analyze when i find the dump.

我还尝试设置选项"-XX:HeapDumpPath = c:\ memdump \ bds.hprof",但是在那里没有创建转储.

I also tried to set the option "-XX:HeapDumpPath=c:\memdump\bds.hprof", but no dump was created there.

有人知道我在做什么错吗? 预先感谢

Anyone got an idea of what i'm doing wrong? Thanks in advance

推荐答案

我发现我可以使用SUN的VisualVM来获得heapdump,并对其进行实时查看.

I found that i could use VisualVM from SUN to get a heapdump, and see it live.

简便解决方案

这篇关于在“内存不足"之后,在哪里可以找到堆转储.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆