Wednesday 27 August 2014

improve performance of eclipse

I have seen many programmers who use Eclipse on 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 development platform for popular languages like PHP, C/C++, Perl, Ruby, Python and shell scripting.Eclipse has a large plugin repository with really powerful set of plugins. 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
Eclipse.ini Tweaks

What is eclipse.ini ?

This file controls the eclipse startup options. You can change make many changes in this file based on your needs to apply settings on launch of eclipse. This is a plain text file containing many command-line options that are appended to the Eclipse startup command.

Backup eclipse.ini before editing it

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.

Where can I find eclipse.ini file?

The location of eclipse.ini varies based on operating systems and is a followsOn 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 terminal and go inside the directory where you extracted eclipse zip file).

Increase The Heap Size Available To Eclipse

: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)

Disable Java Class Verification:

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

 Upgrade your RAM 

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 a dozens of cheap 

RAM for your machine on AmazonUse RamDisc

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 size of JVM.

Upgrade to Solid State Drive (SSD)

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) Reboot/Restart your system often

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 Unwanted Projects

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 makes sure that all caching is used for current working project.

Disable Auto Validation

Set all Validations (Preferences > Validation) to 'Manual' - For example, XML validation is one of a very common validations and may cause slowness if many XML files are present in project.

Disable Automatic Build

Automated build are real help doing quick development since its triggered when any file in project changes, however it may take long time based on the size of project. You can turn off this feature and always do the build manually as needed.

Disable Label Decorations

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

Try A Different JVM

Sometime 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.

Garbage Collection Tweaking

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. Notthing 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 with some kind of virus, malware or adware. Run some anti-virus and cleanup software to make sure.

No comments:

Post a Comment