Better performance from Java IDEs

I have been using Eclipse as my primary Java IDE for some time now. I like most of the features that it offers. However, to get the best performance you have to forgo everything you know about low memory requirement software. Eclipse is not one of those. In fact it is a memory hog.

In fact, if you just use Eclipse straight out the box, you are probably going to feel that is the most sluggish IDE around. This sluggishness is not limited to Eclipse only though (more on this below). So, to get the best performance, you have to weak the settings for the amount of memory that it uses to counteract the effects of Java's garbage collection.

In OS X, you want to hunt for the file eclipse.ini. You can find this file in To get to that folder, you need to right-click on Eclipse and select "Show Package Contents". Find the lines that read -Xms<some_number> and -Xmx<some_number>. The former number represents the minimum heap space size and the latter refers to the maximum heap space size. Change the numbers to something more reasonable like 256 for the minimum memory and 512 for maximum memory. If you run Eclipse now you will feel the difference.

Just a couple of days ago, I downloaded IntelliJ IDEA touted as the most intelligent Java IDE. Well, it does live up to its name. The error and warning messages convey clearer meanings compared to the ones in Eclipse. However, using it out-of-the-box was a bit of an experience. IntelliJ IDEA has a very conservative initial heap space allocation - a meager 32MB. That is definitely not enough. After a couple of minutes of using IntelliJ, it was already doing its garbage collection!

So, it is time to tweak the VM. In OS X, hunt for the file IntelliJ IDEA <some_version>.app/Contents/MacOS/info.plist. info.plist is a XML file that you can open in a text editor. Look for near the end of the file for the VMOptions key and change its string value to something like this. Unix and Windows users can refer to this page to get the location of the configuration file.

Note that the developers of IntelliJ also agree that the default memory settings are not always the best for your larger projects. Therefore, they have also posted an >a href="">article on their blog that details the settings that they use. An important fact that they point out is that allocating a lot of RAM to IntelliJ is not always the best choice since the garbage collector might have to potentially free up a whole bunch of stuff all at once.

IntelliJ has a lot of non-commercial plug-ins available but the better and more complicated ones are usually commercial. These commercial plug-ins can cost more than an academic license for IntelliJ. Their exorbitant cost is one good reason why I will still have to use Eclipse for certain tasks. Another reason is the total number of plug-ins: Eclipse has way more plug-ins than IntelliJ. The last time I checked, there were 827 plug-ins for Eclipse and 370 plug-ins for IntelliJ. That is more than twice the amount so if you are looking for a plugin for some language you are more likely to find as an Eclipse plug-in.

comments powered by Disqus