eclipse 提示:An internal error occurred during: "Building workspace". GC overhead limit exceeded

最近公司给了一个服务端的项目让学习研究相关代码,结果导进eclipse后就出现了以前没有出现过的一个异常现象,eclipse一直显示正在bulideworkspace,eclipse运行很缓慢,什么都做不了几乎,卡的不行,紧接着出现了下面的界面

                          eclipse 提示:An internal error occurred during: "Building workspace". GC overhead limit exceeded

然后两秒后又出现了让离开workspace的提示,说是执行GC要:

                              eclipse 提示:An internal error occurred during: "Building workspace". GC overhead limit exceeded

百度搜索了一大堆后,弄明白了问题出现的原因:是Eclipse默认配置内存太小,需要更改Eclipse安装文件夹下的eclipse.ini文件。

解决办法:打开eclipse安装目录下的eclipse.ini文件,默认是如下的

eclipse 提示:An internal error occurred during: "Building workspace". GC overhead limit exceeded


修改如下:

-Xms512m

-Xmx1024m

第一个是最小的初始化内存,第二个是最大的占有内存

还可以加上 -XX:MaxPermSize=1024m这个意思是在编译文件时一直占有最大内存

贴一个修改好的eclipse.ini配置代码:

-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20140415-2008.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.200.v20150204-1316
-product
org.eclipse.epp.package.jee.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
--launcher.appendVmargs
-vmargs
-Dosgi.requiredJavaVersion=1.6
-Xms512m
-Xmx1024m
-XX:MaxPermSize=1024m


然后重启Eclipse,一切搞定!