Eclipse: High CPU Usage during Autocomplete

I've been using Eclipse without issue (I mean, besides the usual) for several weeks now. It's been speedy enough for my purposes. But as of today around noon, anytime I start typing an HTML tag or other autocomplete-able element, my whole System bogs down so much it's completely unusable. Watching in Task Manager, I show that Eclipse jumps from 0 up to 10-15% every time I type a "<" or ">" symbol!

I have a Core i7 PC with 6 GB of RAM, so this definitely isn't a system specs limitation. I've also uninstalled a couple of programs I installed today hoping maybe one of them was conflicting, but no dice. Even after a restart, I am unable to use Eclipse without pausing for several seconds every time it tries to auto-complete!

Anyone know what's going on here? I did some searching but all I found were VERY old bug reports that say the developers "are aware of the issue and are working on a solution".


First, I'd try bumping up the memory that eclipse has allocated to it:

-vmargs
-Xms2048m
-Xmx3072m
-XX:MaxPermSize 128m

That should be in your eclipse.ini file. This blog has some great reading as far as memory and Eclipse are concerned. Also you can read this lengthy SO thread if you need some more info and / or wish to induce sleep.

Next, try speeding up autocomplete. Go to Window / Preferences / Java / Editor / Content Assist / Auto-Activation and decrease Auto activation delay from 500 to zero.

Finally, you might look into hippie complete; the default key binding in Eclipse is 'alt-/' . This is also called "Word Completion" if you check out the shortcut list 'ctr-shft-l' ( that's L as in list ). On my mac the default key setting is 'ctr-.' . This is a faster version of autocomplete that I believe harkens back to the days of emacs. It seems to work great with local variables but not so great with functions on objects. Different beast I guess.

As a bonus, you can check here for a list of ways to speed up the Eclipse experience in general.


First, just as a test, try switching to a new workspace (File → Switch Workspace → Specify a folder which does not exist, it will be created).

If the problem is solved, this could be an issue with some bad settings or cache in your current workspace. If you can easily move to this new workspace (don't know how much effort you've put in customizing your workspace), I'd do that.

If you want to fix your current workspace, go into the .metadata/.plugins folder of your workspace, and look for folder that start with org.eclipse.wst . I'd try to take them out, and see if it helps (close Eclipse first). You may lose mostly history and cache in the process. You can check the folders specifically and intelligently guess what should stay.

If the problem is not solve by changing workspace, I would try downloading a fresh copy of Eclipse. You could try to reset the configuration folder, but that's a bit risky. If it's too much trouble, I'd start fresh.

链接地址: http://www.djcxy.com/p/90602.html

上一篇: “增加”时无法创建Java虚拟机“

下一篇: Eclipse:自动完成期间CPU使用率高