Pages

Thursday, June 19, 2014

Eclipse Recommended Heap Size for Macbooks 2009+

If you have a Macbook from 2009 and up, you should have at least 4 GB of RAM (e.g., PC3-8500 DDR3 1066 MHz). And, if you are using Eclipse, you should definitely increase the initial and maximum Java heap size. Why you ask? Let us consider this example: You're doing some awesome JavaScript development (yeah, there is a plugin for that). You want to load in some precomputed arrays via server-side include so you develop with this file in the project directory. Eclipse loads the 32MB file into the Heap and crashes. True story.

The problem is that the minimum Java heap for Eclipse, by default, is 40MB and the maximum allowable size was 512MB. You can imagine that this will be depleted quickly. To Eclipses benefit, it doesn't actually crash. It just fails to load the source file (or *file), stops loading, complains to the user by throwing an OutOfMemory error, and tries again. If you're using OS X 10.6+, the simple fix is to modify -Xms and -Xmx in the eclipse.ini file. This is found here /opt/eclipse/Eclipse.app/Contents/MacOS/eclipse.ini or wherever you placed Eclipse (e.g., common placement is /Applications or ~/). 

Before closing out this short post, lets try something new. I wonder if hyperlinks to the filesystem will work. This is for OS X users that are interested ONLY: file:///Users/Shared/. Ok, it doesn't. I am allowed to publish the link but the browser will not resolve it. Interesting!


No comments:

Post a Comment