Tweaking 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:

Comments (Comment Moderation is enabled. Your comment will not appear until approved.)
Dan Parker's Gravatar Wow, thanks for the tips! I put them to use and it sped mine up tremendously! The only thing I did differently was to specify the JVM in the ini file. Mine looks like this:

-vm C:\Program Files\Java\jre1.5.0_09\bin\javaw.exe
-vmargs
-Xms256m
-Xmx768m

Thanks again!
# Posted By Dan Parker | 4/17/07 5:12 PM
Mark Ireland's Gravatar So dont use C:/Windows/System32/javaw.exe because it is not supported?
# Posted By Mark Ireland | 4/30/07 2:35 AM
Wayne Graham's Gravatar I believe the way that Windows installs the JVM is that the most recent version of javaw.exe gets thrown into your System32 folder. If you want to use a version of the JRE that is not this version, you would need to use the -vm switch to point to the location of the JRE you want to use.

As a side note, I've noticed that 1.6 goes a bit faster and crashes less often than does running Eclipse with the 1.5 VM.
# Posted By Wayne Graham | 4/30/07 8:22 AM
Diego's Gravatar GOD BLESS YOU!!!
# Posted By Diego | 7/27/07 4:07 AM
GT Terry's Gravatar You just saved my bottom!@!!!! Thank you.
# Posted By GT Terry | 8/19/07 12:06 PM
origo's Gravatar Thanks a bunch! The "change VM" tweak cut my startup from 45 seconds to 15!
# Posted By origo | 8/26/07 5:02 AM
Thijs Triemstra's Gravatar The FlexBuilder.ini file of the standalone version for Mac OSX can be found in /Application/Adobe Flex Builder 3/Flex Builder.app/Contents/MacOS/FlexBuilder.ini
# Posted By Thijs Triemstra | 9/16/07 3:54 AM