我正在使用 Eclipse Mars.2 Release (4.5.2),我的操作系统是 Ubuntu 14.04 LTS。我在 Eclipse 中构建的任何项目都会遇到一些问题,当构建进度约为 80% 时,CPU 使用率甚至达到 300%,并且 IDE 被卡住或抛出一些错误/异常(GC 开销、内存不足等)。该项目很大,但对于同一个项目,直到几天前它都运行正常。我的 eclipse .ini 是:
-startup
plugins/org.eclipse.equinox.launcher_1.3.100.v20150511-1540.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.300.v20150602-1417
-product
org.eclipse.epp.package.jee.product
--launcher.defaultAction
openFile
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
--launcher.appendVmargs
-vmargs
-Dosgi.requiredJavaVersion=1.7
-XX:PermSize=256m
-XX:MaxPermSize=512m
-Xms1048m
-Xmx4048m
有什么想法吗?
最佳答案
您确定您的操作系统是 Ubuntu 14.04 LTS 而不是 16.04 LTS 吗?因为在 Ubuntu 16.04 中这是一个已知问题:
在您的 eclipse.ini 文件中,您可以添加
--launcher.GTK_version
2
在 -vmargs
之前(请参阅 Ubuntu bug #1552764 )。
但更好的解决方案是使用 Eclipse Neon它解决了这个问题并已于周三发布。
关于java - Eclipse:构建项目时 CPU 使用率高,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38011133/