內(nèi)存泄漏 - eclipse新建static web project,使用中一直提示GC overhead limit exceeded
問(wèn)題描述
我用eclipse新建了一個(gè)static web project,在使用過(guò)程中一直提示GC overhead limit exceeded,我在百度也找了一些辦法,比如不選擇build automaticly,去掉不需要的validation,在eclipse的eclipse.ini中的-Xms和-Xmx設(shè)置大,將permsize也設(shè)置大,觀察了一下,發(fā)現(xiàn)還是不斷的在吞噬內(nèi)存。
我覺(jué)的很奇怪,只不過(guò)是靜態(tài)頁(yè)面,為什么eclipse會(huì)不斷的去做gc,又不需要編譯java代碼。
問(wèn)題解答
回答1:看錯(cuò)誤提示,應(yīng)該是后臺(tái)索引任務(wù)吃掉你的內(nèi)存了,試試看看能不能禁用索引。 最好貼一下你最后使用的eclipse.ini永生代不需要設(shè)置的過(guò)大。
修改了你的MaxPermSize設(shè)置,并增大了最大內(nèi)存。
-startupplugins/org.eclipse.equinox.launcher_1.3.100.v20150511-1540.jar--launcher.libraryplugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.300.v20150602-1417-productorg.eclipse.epp.package.jee.product--launcher.defaultActionopenFile-showsplashorg.eclipse.platform--launcher.XXMaxPermSize256m--launcher.defaultActionopenFile--launcher.appendVmargs-vmargs-Dosgi.requiredJavaVersion=1.7-Xms512m-Xmx2048m回答2:
你好,這個(gè)是我的eclipse.ini
-startupplugins/org.eclipse.equinox.launcher_1.3.100.v20150511-1540.jar--launcher.libraryplugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.300.v20150602-1417-productorg.eclipse.epp.package.jee.product--launcher.defaultActionopenFile--launcher.XXMaxPermSize1024M-showsplashorg.eclipse.platform--launcher.XXMaxPermSize1024m--launcher.defaultActionopenFile--launcher.appendVmargs-vmargs-Dosgi.requiredJavaVersion=1.7-Xms1024m-Xmx1600m-XX:NewSize=256m-XX:MaxNewSize=256m
