內存泄漏 - eclipse新建static web project,使用中一直提示GC overhead limit exceeded
問題描述
我用eclipse新建了一個static web project,在使用過程中一直提示GC overhead limit exceeded,我在百度也找了一些辦法,比如不選擇build automaticly,去掉不需要的validation,在eclipse的eclipse.ini中的-Xms和-Xmx設置大,將permsize也設置大,觀察了一下,發現還是不斷的在吞噬內存。
我覺的很奇怪,只不過是靜態頁面,為什么eclipse會不斷的去做gc,又不需要編譯java代碼。
問題解答
回答1:看錯誤提示,應該是后臺索引任務吃掉你的內存了,試試看看能不能禁用索引。 最好貼一下你最后使用的eclipse.ini永生代不需要設置的過大。
修改了你的MaxPermSize設置,并增大了最大內存。
-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:
你好,這個是我的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
