For several years of programming, I did not know how to speed up eclipse. I always used the default settings of the Eclipse and never tried to tweak it. Many of my colleagues complained that eclipse is slow and moved to other IDEs, however, I chose to do more research and tried to find ways to improve eclipse performance.
I have seen many programmers who use Eclipse on a variety of different languages and platforms.
A lot of people do not know that Eclipse is a multi-language general-purpose platform. Eclipse does much more than any Java IDE can do. It’s also commonly used as an application framework and as a development platform for popular languages like PHP, C/C++, Perl, Ruby, Python and shell scripting.
Eclipse has a large plugin repository with a really powerful set of plugins. As we start using our eclipse setup more and more we require even more set of plugins to be productive. This is quite natural, however, having a lot of plugins in one eclipse setup makes it a really fat application with a lot of things to be done at the same time.
At times you may be stuck with a badly written plugin that may affect whole of you eclipse setup.
It is very obvious that this powerful tool can do a lot of things for us. In this article, I am trying to compile all the list of things I have personally learned and used for keeping my eclipse setup best performing.
There are many performance enhancements done in recent version of eclipse. If you are using an older version you may want to try the latest version first to see its performance.
Eclipse has a huge community of developers and enhancements to the platform are done really fast. It may not be always easy to keep up with the latest version, however, I would recommend you to be as close to the latest stable release as possible.
Another downside of being at the latest version is that all plugins may not be available. So if you are stuck with older versions due to one of the older plugins or some other reasons you may want to skip this step and jump to the options listed below.
What version of Java are you using? The latest version of java JVM along with the latest eclipse version would be the best performance option. However, this may be totally depending upon what are your project needs. If you can upgrade to latest java versions if may help you a bit.
Use Separate Eclipse Install for Projects with Different Plugin needs
I have some projects that use Google AppEngine, some Android projects, and some standard Java projects. I’d like to keep these three separate, as the app engine and Android projects require extensive plugins to be installed that slow Eclipse down and interfere with other functions.
It may sound a little weird, however, I personally prefer to keep separate installs of the Eclipse for a different type of projects. This ensures that your eclipse setup has minimum plugins required. For example:
- Keep a separate Eclipse install for all your android projects.
- Keep a separate Eclipse install for JEE Web Projects.
- Keep a separate Eclipse install for Google App Engine Projects.
- Keep a separate Eclipse install for Spring Tool Suite related projects
- Keep a separate Eclipse install for each of the different language projects e.g Ruby, Python, etc
I have tried working on many projects on same eclipse setup and the eclipse becomes dead slow even if I keep all un-used projects closed. In general, have all related projects that require the same set of plugins in one install and switch to other installation when you need to work on another project.
The important thing to note is that creating a separate workspace in the same install does not really help since the eclipse is not smart enough to load plugins selectively for the current workspace. This enhancement may be done in future releases, however currently our best option is to keep a separate install for projects with similar plugin needs.
This file controls the eclipse startup options. You can change make many changes in this file based on your needs to apply settings on the launch of the Eclipse. This is a plain text file containing many command-line options that are appended to the Eclipse startup command.
Before you jump on to editing this file, please make sure to take a backup of the original file just to ensure that in case of any issues you may want to revert back to the original file.
The location of eclipse.ini varies based on operating systems and is a follows
On Windows/Linux: eclipse.ini is located in your Eclipse installation directory. It should in the same directory as your eclipse.exe (on Windows) or eclipse binary (on Linux) is located.
On Mac OS: Eclipse.app/Contents/MacOS (This may not show up on finder, so go on the terminal and go inside the directory where you extracted the Eclipse zip file)
As you may already know that eclipse is a java program and providing it more heap memory is going to help it cache and speed up. You can increase the heap size by updating the entry for option -Xmx to some higher number in eclipse.ini (e.g. -Xmx2048m)
Add -Xverify:none to your eclipse.ini. – It will reduce the eclipse startup time considerably. This option disables the class file validation while loading. This can be a real performance boost if you are having a large project with many .class files.
Memory/Hardware Related Tweaks
Eclipse is a greedy application it can cache more if memory is available. The more RAM you will provide it the better it can perform. You can find dozens of cheap RAM for your machine on Amazon
Putting the JVM in RAM Disk may improve the performance. RAM Disk is a freely available option on Linux systems, however, for windows, you may want to look for a commercial option ramdisk driver from Qsoft http://members.fortunecity.com/ramdisk/RAMDisk/ramdriv001.htm Make sure to allow additional space to the ramdisk that is 10-20% more than the size of JVM.
Eclipse deals with a lot of small files including source code, compiled files, metadata, local history, svn, etc. And, the type of hard disc you have will impact all the IO actions eclipse performs. You may see a significant performance enhancement if you upgrade to an SSD (Solid State Drive)
I know this may sound funny. I have a really bad habit of never shutting down my system until it becomes unbearable. Doing occasional restarts within a week is going to keep your system faster. This is more of a general tip that may apply not only to eclipse but to any other software. I have seen my laptops getting really slow if I use the sleep/hibernate modes with them. After the restart, everything works great.
Disable Unwanted Features Per Project Needs
Close any open projects which are not in current use. This may sound trivial, however, at times some big projects can really slow down the performance. Closing unwanted projects make sure that all caching is used for the current working project.
Set all Validations (Preferences > Validation) to ‘Manual’ – For example, XML validation is one of very common validations and may cause slowness if many XML files are present in the project.
The automated build is real help doing quick development since it triggered when any file in project changes, however, it may take a long time based on the size of the project. You can turn off this feature and always do the build manually as needed.
Another performance boost can be gained by disabling label decorations (Windows -> Preferences; General -> Appearance -> Label Decorations) and by disabling unused capabilities on startup (Windows -> Preferences; General -> Startup and Shutdown)
JVM Specific Tweaks
Sometimes a specific vendor version of JVM may not be performing very well on your operative system. For example, Use Oracle JVM on Ubuntu for faster performance. The default JVM on Ubuntu makes eclipse slow for some reason, try to install the Oracle JVM and you may see a significant performance change.
You may also get additional performance by choosing a different garbage collection strategy depending on your JVM. This may be used as a last option, however, I do not really recommend it. You may want to really understand garbage collection tuning well before you can get some good results.
Nothing Seems to Work?
In case, you have tried all of these options and nothing seems to work you may want to make sure that your system is not affected by some kind of virus, malware or adware. Run some anti-virus and cleanup software to make sure.
I have been using Eclipse for more than 15 years now, so I suppose I am reasonably familiar with it. I have spent a lot of time and learned it hard way over time, but hopefully, you don’t have to waste a lot of time like I did. Do you find these tips useful and help in improving your productivity at work? What are your favorite tricks in using eclipse productively?
- Updated on May 2019: Minor changes and updates to the introduction section. Images are updated to HTTPS.