Make Eclipse Run Blazingly Fast On Mac OS X

If you use Eclipse on OS X, you’ve probably been frustrated by how slow it can be. As it turns out, this can be easily improved upon!

Eclipse uses Java 1.5 by default in OS X. This is probably for compatibility reasons, but I don’t know for sure. Regardless, I got a huge boost by modifying my eclipse.ini with the following settings:
-Dosgi.requiredJavaVersion=1.6
-XX:PermSize=256m
-XX:MaxPermSize=256m
-Xms1024m
-Xmx1024m

The key change is the first line, Dosgi.requiredJavaVersion. Make sure it is set to 1.6. The other settings deal with the amount of memory allocated to the JVM for various purposes. The settings I’ve listed above may be too aggressive if you only have 4GB of RAM, but you can play around with them if you want, or leave them as they already are configured. The important thing is changing to Java 1.6.

You may be wondering, “where can I find the eclipse.ini file?”. You need to navigate to the Eclipse application in Finder, then right-click and select “Show Package Contents”. Then open the Contents/MacOS folder and you’ll find your eclipse.ini. Spotlight will not find it because it’s inside the application bundle. Of course, you could also use Terminal, but I’ll assume that if you use Terminal, you can find it on your own ;-).

Enjoy! This made Eclipse much faster / more responsive for me.

By the way, if you’re still on OS X Leopard, the default JVM there is 1.5. I’m not sure (since I don’t have Leopard anymore), but you might need to adjust your Java Preferences. See: Selecting Java version on OS X Leopard.