简体   繁体   中英

Eclipse running out of memory and running slow

Although I've found similar questions, I've seem to run out of suggestions and thought of asking SO for what I've left to do.

I am running out of memory while using Eclipse and it starts to crawl after a couple hours to the point where I have to Force Quit. Initially it would hang and say things like "heap space out of memory." I searched on SO for things like:

Eclipse indexer hangs with 100% cpu
Eclipse running out of memory
Eclipse java heap space out of memory

So I started to incorporate all of the suggestions, with negligible improvement. Here are all of my current changes.

I've been running eclipse with eclipse -debug.options so I can check memory usage

where the.options file has:

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

I've updated my /etc/eclipse.ini file to say (was before -Xmx384m so max size is much larger now)

openFile
-vmargs
-XX:MaxPermSize=256m
-Xms40m
-Xmx2048m

I've also updated the indexer options (Window -> Preferences -> C/C++ -> Indexer)

Cache limit relative to heap size: 25%
Absolute limit: 256 MB
Header file cache: 256 MB

I also unchecked Project -> Build Automatically because on any change it would momentarily hang and build the workspace

I've also updated the history options (Window -> Preferences -> General -> Workspace -> Local History)

Days to Keep files: 1
Maximum entries per file: 50
Maximum file size (MB): 1

Lastly, in the resource filter (Project -> Properties -> Resource -> Resource Filters) I told it to ignore indexing files and folders that match *dox

Exclude all: Name matches *dox (file and folders)

When it starts to get super slow I'll hit ctrl + \ where I ran eclipse and I'll see that its using 100% of the heap space. Trying to increase the maximum size (-Xmx) beyond 2048 MB results in it complaining that it can't start the VM, but I'm wondering if this isn't exactly a case of how much space I give it.

I keep the progress window open so I can see what it's trying to do, and usually it seems to get slower while indexing, but when it's crawling, it'll be so bad that merely scrolling seems to make it hang. I usually have no choice but to close Eclipse and reopen (after about 2 hours).

What else is there left to try? Is this solely a memory issue? What else can lead me to discovering why it starts to crawl?

This is on Ubuntu 12.04 and Eclipse 3.7.2 and Java OpenJDK 1.6.0_30-b30

After 1 month of nice CDT-Eclipse work I suddenly faced today the same problem. I have tried to increase memory parameters, to uninstall plugins etc but fruitless. But than I found really helpful advice:

"Whenever you create a new workspace for a Mozilla source tree, you should be sure to turn off the following two settings in the workspace preferences (Window > Preferences, or Eclipse > Preferences) before creating a project in that workspace:
- in "General > Workspace", disable "Build automatically"
- in "C/C++ > Indexer", disable "Automatically update the index"
https://developer.mozilla.org/en-US/docs/Eclipse_CDT

And my problem disappeared.

It's probably a certain add-on. You should remove them all and try adding them back one-by-one. I've experienced this same kind of behavior with a certain code coverage plug-in, can't remember which one right now. Anyway, give that a try and see if you can pinpoint which one it is. Then you'll just have to find some alternative add-on for that one, that you can use instead.

I've endured this issue for years. Tried every possible combination of java flags, removed plugins etc. It doesn't help. It might help for a specific project but when you get to a certain cpp file with heavy usage of macros or templates it will run out of memory.

You can either turn off indexing or switch to another IDE. Why? Because Eclipse CDT is ignoring this since at least 2010.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM