Tweaking Eclipse

07 Sep 2006 . . Comments

#java #Windows #Eclipse

I finally got fed up yesterday with the slow speed at which Eclipse was launching on my Windows box. On my Linux box, it doesn’t take that long to launch (may five or six seconds) compared to my Windows box (around 15 - 20 seconds). I know I have a lot of plugins, but it was getting a little ridiculous. I started poking around and I noticed in the configuration details (Help / About Eclipse SDK / Configuration Details) that the vm that was launching was 1.4. Ok, so there’s one problem. I also noticed that the max memory setting was 256MB (-Xmx256M). Since this box has 2GB of RAM, I figured 256MB is a little on the low side (and note, mucking around with the heap sizes won’t help load times).

The first thing I did was change the shorcut target for Eclipse to be

C:\eclipse\eclipse.exe -vm "C:\Program Files\Java\jdk1.5.0_08\bin\javaw.exe"

Now I’m sure that Eclipse will launch with Java 5 and (hopefully) speed things up a bit. Double-click on the short-cut, and sure enough, we’re down to about 8 seconds.

The next thing I wanted to do is increase the default min and max memory settings. In c:\eclipse\eclipse.ini, you’ll see

-vmargs
-Xms40M
-Xmx256M

I changed these to

-vmargs
-Xms256m
-Xmx768m

This increases the minimum memory space to 256M and the maximum to 768M. You can also do this by adding these vmargs to the shortcut target:

C:\eclipse\eclipse.exe -vm "C:\Program Files\Java\jdk1.5.0_08\bin\javaw.exe" -vmargs -Xms256M -Xmx768M

If you have a multi-processor computer (and I believe this includes dual-core systems, though I haven’t read the docs on this), you can use some of the new VM ergonomics to self-tune garbage collection by adding this switch:

-XX:+UseParallelGC

One last handy parameter is “-showlocation” which shows the current location of your workspace. If you have different workspaces, this is handy.

If you want to read more about some JVM garbage collection (and who doesn’t) here are some helpful links: