Sunday, August 22, 2010

Increase Java Heap memory?

In the release notes for Eclipse (readme/readme_eclipse.html in the Eclipse folder), in the Running Eclipse section, it talks about allocating extra memory for the Java VM.  I have 6GB of RAM in my Mac so that sounded like a nice thing to do, to try to help Java to run faster.  It says to use "eclipse -vmargs -Xmx<memory size>" when launching Eclipse.  On a Mac, you typically would just click on the icon instead of running from the command line, so they have a link just above this in the notes to special instructions for running on a Mac.  There it tells you to edit the eclipse.ini file in order to fiddle with command line arguments.

One of the lines in my eclipse.ini file is just: -vmargs
so I edited it to look like this: -vmargs -Xmx1024M
since the default is "256M".  However, when I run Eclipse this way, it runs out of memory very quickly.  Clearly something is wrong.  So I try again with: -vmargs -Xmx512M
This also causes Eclipse to run out of memory.  Since I clearly don't know what I'm doing, I just revert it back to the way it was and leave it alone for now.  I may revisit this later.

No comments:

Post a Comment