錯(cuò)誤信息:
Exception in thread "http-bio-8080-AsyncTimeout" java.lang.OutOfMemoryError: Java heap space
錯(cuò)誤原因:
內(nèi)存中加載的數(shù)據(jù)過(guò)大,這個(gè)錯(cuò)誤是在運(yùn)行項(xiàng)目時(shí)查詢(xún)出4萬(wàn)多條數(shù)據(jù)時(shí)報(bào)出的。
解決方式:
把應(yīng)用服務(wù)器的啟動(dòng)參數(shù)內(nèi)存值設(shè)置足夠大,具體步驟如下所示株依。
1.打開(kāi) eclipse 安裝路徑下的 eclipse.ini 文件,將以下配置信息在文件的對(duì)應(yīng)位置進(jìn)行修改延窜。
openFile
--launcher.XXMaxPermSize
512M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
512m
--launcher.defaultAction
openFile
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Dhelp.lucene.tokenizer=standard
-Xms128m
-Xmx1024m
修改 eclipse 配置文件
2.找到 eclipse 中的 servers 標(biāo)簽恋腕,打開(kāi) tomcat 設(shè)置界面。
打開(kāi) servers
3.在 tomcat 設(shè)置界面找到 Open launch configuration 并打開(kāi)需曾。
打開(kāi) Open launch configuration
4.按照下圖的標(biāo)識(shí)進(jìn)行設(shè)置吗坚,VM arguments 尾部添加如下信息:
-Xms128m -Xms1024m -XX:MaxPermSize=512m
修改 VM arguments