How to get better memory settings for Eclipse on Mac OS X

In Eclipse 3.1M6, the default memory settings were increased. This was done by putting in the eclipse.ini file:

-vmargs
-Xms40m
-Xmx256m

This probably works on Windows, Linux, and other platforms, but not on the Mac. So when you launch 3.1M6 on the Mac, you’ll get the old, sub-optimal memory settings:

-Xms30M -Xmx150M

How to increase the memory settings?

Well, you could do it via the command line. But a nicer, more Mac-oriented way is to open up the Eclipse.app package, by control-clicking or right-clicking on the Eclipse icon in Finder and then choosing “Show Package Contents.” Then navigate into Contents. Then double-click the Info.plist file. This should open up the Property List Editor.

Expand the tree to get to Root/Eclipse. Then change -Xms30M and -Xmx150M to your preferred memory settings. The Eclipse Team suggests 40M to start and 256M as the max.

I like to push it to the limit. I also tend to work with large projects. And I’ve got a lot of RAM: 1.5GB in my 17″ PowerBook. Eventually I will probably swap out the 512MB chip with another 1GB chip to get up to 2GB, which is the max for PowerBooks. BTW, more RAM definitely improves the computing experience, on any platform. So, I like to start with 256M and make the max something like 512, yielding the arguments:

-Xms256M

and

-Xmx512M

Extreme? Maybe. But if Eclipse is your main work environment and you’ve got a lot of RAM, then I think it makes sense.

(Thanks to both Marcelo and Kim for pointing this out on the Eclipse Mac group.)

2 Replies to “How to get better memory settings for Eclipse on Mac OS X”

  1. I’ve been experimenting with other VM arguments in an effort to not have to allocate so much memory to the heap. In fact, I’ve found some settings (on Windows) that let me run reasonable with only a 96m heap. Keep in mind that I run with the entire platform checked out from CVS in addition to other skunkworks projects. These are my settings:

    -Xverify:none -Xms40m -Xmx96m -XX:PermSize=20m -XX:+UseParallelGC -XX:CompileThreshold=100

    I’m dying to try them (or the equiv.) out on my Powerbook when it returns.

  2. eclipse.ini problems on Mac:

    We are in the process of streamlining the Eclipse/RCP configuration options across different platforms in order to make it easier to write tools that generate configuration files.
    As a consequence, I’m in the process of moving all options from the non-standard Info.plist file to the standard eclipse.ini.
    While doing this I ran into the following problems:
    – the eclipse.ini file wasn’t recognized because it was in the wrong location. Make sure that eclipse.ini is in Eclipse.app/Contents/MacOS
    – if there is a single VM argument (“-vmargs”) specified in Info.plist, *all* VM arguments in eclipse.ini are ignored. So make sure that all -vmargs are moved to eclipse.ini

    In recent builds these problems have been addressed.

Comments are closed.