日期:2014-05-20  浏览次数:20776 次

没有任何服务器相关的程序OutOfMemoryError,以下是错误LOG
这个程序涉及到网页下载和解析,页面解析,读写XML和HIBERNATE
一般在运行10多个小时后就会这样挂掉,我这里把错误日志和JPROFIER的结果贴出来,大家帮我看看啊


Jprofiler的结果(只取了前面部分)
类 对象数 空间
org.htmlparser.lexer.PageAttribute 103,519 4,852 kB 
java.lang.String 79,754 1,869 kB 
<class>[ ] 66,812 3,801 kB 
java.util.Vector 44,931 1,053 kB 
char[ ] 26,324 27,841 kB 
org.htmlparser.nodes.TagNode 24,660 963 kB 
org.htmlparser.nodes.TextNode 19,694 615 kB 
org.htmlparser.util.NodeList 14,285 334 kB 
java.util.HashMap$Entry 6,357 148 kB 
java.util.Hashtable$Entry 5,677 133 kB 
org.htmlparser.tags.LinkTag 4,081 191 kB 


#
# An unexpected error has been detected by Java Runtime Environment:
#
# java.lang.OutOfMemoryError: requested 1310720 bytes for GrET in C:\BUILD_AREA\jdk6\hotspot\src\share\vm\utilities\growableArray.cpp. Out of swap space?
#
# Internal Error (414C4C4F434154494F4E0E494E4C494E450E4850500017), pid=1548, tid=5620
#
# Java VM: Java HotSpot(TM) Client VM (1.6.0-rc-b66 mixed mode)
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
#
--------------- T H R E A D ---------------

Current thread (0x0acb9c00): VMThread [id=5620]

Stack: [0x0acd0000,0x0ad20000)
[error occurred during error reporting, step 110, id 0xc0000005]

VM_Operation (0x0d2cf4b4): generation collection for allocation, mode: safepoint, requested by thread 0x1535e000




------解决方案--------------------
native 内存泄露,jprofiler在装载本地动态库需要消耗很多内存,导致内存不够用,把xms xmx设置小一点
------解决方案--------------------
内存空间不够,和long[] a = new long[9999999999999999]一样的错误,在堆栈中存处的数据过多