Thursday, May 19, 2011

Optimizing Eclipse for Mac OS X

This section will outline a few options that can increase the performance of running Eclipse on the Mac OS X platform. To do this you need to modify the eclipse.ini file. by right-clicking (or Ctrl+click) on the Eclipse executable in Finder, choose Show Package Contents, and then locate eclipse.ini in the MacOS folder under Contents.

  • Open the Finder Locate the Eclipse program 
  • Right-click on the Eclipse program, select “Show Package Contents” 
  • Open the Contents folder 
  • Open the MacOS folder 
  • Open the eclipse.ini file with TextEdit
  • Change the file contents to add/update the following: 
-showsplash org.eclipse.platform 
--launcher.XXMaxPermSize 256m 
-vm /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/bin/java 
-vmargs 
-Xms128m 
-Xmx512m

It’s important to note a few things.  The “-vm” argument must be on it’s own line.  After that you can specify your Java virtual machine to make sure you’re using the latest version.  This probably isn’t a big deal on the Mac platform, since there’s usually only one provided by Apple, but on a Windows system you may have a plethora of Java installs.

Also the “-vmargs” must come AFTER you specify the version of Java to use.  After this you can specify the memory settings for the JVM.  I’m setting the default memory allocation for Eclipse to be 128MB and the maximum to be 512MB.   You can adjust yours accordingly.

No comments: