05 Jan 2009 - 10:49:55 am
Eclipse performance tweaks
31
Oct
Here's a couple of tips on how to squeeze that extra speed out of Eclipse. (Do note that for some of these tips you might need to restart Eclipse in order to effect the changes.)
-
Close unused projects
Close those projects which you don't need to work on. If I have projects which I don't need to work on more than a few days, I'd close them, keeping opened projects to the basic minimum. Fewer open projects mean fewer files Eclipse need to manage.
-
Disable folding
Disable Automatic Folding in Windows > Preferences > Java > Editor > Folding. Untick the 'Enable Folding' check box.
-
Disable Content Assist
Those cool widgets which pop up and assist your coding can be real nice, but they can slow Eclipse down by magnitudes. To disable Content Assist, go to Windows > Preferences > Java > Editor > Content Assist > Untick the "Enable Auto Activation" check box.
I know this tip will disable the uber cool Content Assist by not popping up automatically while you type or dot a method invokation, but you can still access this manually by hitting CTRL+SPACE whenever you need help. Try it! Before you know it, it'll be second nature.
-
Remove/undeploy unused contexts and applications.
This is not really an Eclipse tip per-se but often when developing Web apps, you'll be running a servlet container or application server (Apache Tomcat, BEA Weblogic, IBM Websphere etc) at the same time. Remove unused contexts and applications from your app server. Sample and pre-installed applications would be guilty of this. Less contexts/applications used, less RAM used by your server. You can always redeploy anything you need again. Simple, no?
-
Change Heap memory used by Eclipse.
By default, Eclipse gets allocated a pitiful amount of memory by the Java VM. The result is the ever-frustrating OutOfMemoryException. You can change this amount by modifying certain configuration parameters when launching Eclipse.
On Windows:
If you're launching Eclipse from command line, include the -Xms and -Xmx parameters with values larger than 64MB for Xms and 128MB for Xmx.
e.g: -Xms128m -Xmx256m
On Mac OSX:
Edit the /Eclipse.app/Contents/Info.plist file and modify the Xms and Xmx settings.
Sometimes, increasing the above setting to huge amounts would still yeild errors such as PermGen errors. This PermGen error comes when the VM runs out of PermSpace, which is an area where the VM stores java class definitions and structures of data. To combat this, you can add the switch -XX:MaxPermSize=128m.
Having said this, sometimes, with framework such as Spring with Hibernate, you can still get errors. I've had success switching Java Runtimes Environments instead. BEA JRockit seem to work well where Sun's JRE fail with PermGen in these instances.
Do take care to be aware of your computer's limitations. What memory you allocate to Eclipse would mean less memory for your computer overall. This could mean making things worse instead. I'd recommend running Eclipse on no less than 1GB of RAM if you intend to tweak Eclipse's memory settings. YMMV.
-
MyEclipse Tip: Disable validators
MyEclipse is a full-featured IDE based on Eclipse and has a powerful runtime validators to validate everything from JSP files to DTD to even JavaScript. These comes with a cost of performance however.
Disable by:
Windows > Preferences > MyEclipse > Validation;
Tick on the 'Suspend all validators' check box.

Syndication