虽然我发现了类似的问题,但我似乎已经没有任何建议,并且想过要求SO留下我要做的事情.
我在使用Eclipse的时候内存不足,它在几个小时后开始爬行到我必须强制退出的程度.最初它会挂起并说"堆空间内存不足".我在SO上搜索过类似的东西:
Eclipse indexer hangs with 100% cpu
Eclipse running out of memory
Eclipse java heap space out of memory
Run Code Online (Sandbox Code Playgroud)
所以我开始考虑所有建议,但改进可以忽略不计.以下是我目前的所有变化.
我一直在使用eclipse -debug .options运行eclipse,所以我可以检查内存使用情况
.options文件的位置:
org.eclipse.cdt.core/debug/pdomtimings=true
org.eclipse.cdt.core/debug/indexer=true
org.eclipse.cdt.core/debug/parser=true
org.eclipse.cdt.core/debug/deltaprocessor=true
org.eclipse.cdt.core/debug/scanner=true
org.eclipse.cdt.core/debug/model=true
Run Code Online (Sandbox Code Playgroud)
我已经更新了我的/etc/eclipse.ini文件(在-Xmx384m之前,所以最大尺寸现在要大得多)
openFile
-vmargs
-XX:MaxPermSize=256m
-Xms40m
-Xmx2048m
Run Code Online (Sandbox Code Playgroud)
我还更新了索引器选项(Window - > Preferences - > C/C++ - > Indexer)
Cache limit relative to heap size: 25%
Absolute limit: 256 MB
Header file cache: 256 MB
Run Code Online (Sandbox Code Playgroud)
我还取消选中Project - > Build Automatically,因为在任何更改时它都会暂时挂起并构建工作区
我还更新了历史记录选项(窗口 - >首选项 - >常规 - >工作区 - …