Jess
Jess

Reputation: 25157

Eclipse Juno bad performance slow hangs freezes in Java Editor

I am having very bad performance problems with Eclipse Juno 4.2.

I can consistently reproduce the issue with in my workspace. The problem is only with *.java files. Here are the steps to reproduce:

  1. I open a workspace with java files
  2. wait for "Initializing Java Tooling" to finish
  3. open a java file in the Java Editor
  4. type some garbarage... let eclipse underline it with red.
  5. put my mouse over the red word
  6. Hang/Freeze for 10 seconds.

I have tried many things. I tried a few changes to eclipse.ini. Didn't help. I just tried turning off Report problems as you type. Now the issue has changed. Eclipse will no longer underline errors in red. Now when I save a java file it takes 10 seconds.

I tried renaming my workspace.xmi. (That seems to reset workspace back to "factory" settings) That did not help.

I can use Eclipse Juno to open other workspaces that do not have java files and there is no performance issue.

Upvotes: 0

Views: 624

Answers (2)

vintuwei
vintuwei

Reputation: 818

add this line to eclipse.ini

-Dorg.eclipse.swt.browser.DefaultType=mozilla

Upvotes: 0

Jess
Jess

Reputation: 25157

If you need a generic troubleshooting method for eclipse on linux/mac OS, then strace is for you. I'm 2 for 2 with it.

I used strace a long time ago to troubleshoot an eclipse issue and I'm glad I documented it on my blog because it's really not trivial. Eclipse uses so many threads.

Anyway, I found one strace log where it was trying to access a very strange file in a network directory that is the directory of one of my coworkers! I found that the .classpath was checked into git with his network paths. I suppose eclipse was trying to access those paths and was timing out. Here's an example of the .classpath:

<classpathentry kind="lib" path="/net/dir/myfriend/.m2/repository/blah/blah.jar">
    <attributes>
    ...
    </attributes>
</classpathentry>

I removed these paths from the .classpath files. (Regenerated some using maven and removed the sourcepath attribute for some others.)

Now eclipse is running FAST!!!!!

Upvotes: 1

Related Questions