Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Optimizing Eclipse for Android development

I develop Android using Eclipse and the ADT plug-in... and it's... slow.

I have to restart frequently and it gets painfully worse when I have various Android projects open (needed for when I use library projects).

Are there any specific optimizations that I can make to improve Eclipse performance when using the ADT plug-in?

like image 303
hpique Avatar asked Sep 06 '10 22:09

hpique


People also ask

Is Eclipse good for Android development?

Android Studio is specifically designed to build Android applications but Eclipse is useful for building android as well as other web and desktop applications.

Which Eclipse is best for Android development?

Eclipse Classic 3.6. 1. Eclipse IDE for Java EE Developers.

Is Eclipse good for app development?

Eclipse is preferred for creating small android applications. Eclipse IDE is an open-source software used by developers, it contains a variety of plugins to create software in different programming languages. We will be using Eclipse IDE to set up Android App Development.

Is Eclipse faster than Android studio?

Android Studio is faster than Eclipse. There is no need to add a plugin to Android Studio but if we use Eclipse then we do need to. Eclipse needs many resources to start but Android Studio does not. Android Studio is based on IntelliJ's Idea Java IDE and Eclipse uses the ADT Plugin to develop Android applications.


1 Answers

First make sure you have a fairly recent version of Java and Eclipse and the ADT plug-ins. Especially Java.

Then close Eclipse and look at the directory where you installed Eclipse. See a file called eclipse.ini there? Make a backup copy, then open it in a text editor. Look at the last few lines. You'll see something similar to the following:

--launcher.XXMaxPermSize
512m
-showsplash
org.eclipse.platform
--launcher.defaultAction
openFile
-vm
C:/Program Files/Java/jdk1.6.0_24/bin
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms512m
-Xmx2g

Don't worry if it doesn't look exactly like that, and don't change anything except the options I'm about to describe. Each option starts on its own line with no white space.

The important parts for performance are the max permanent generation size option, set with these two lines (that must appear before -vmargs):

--launcher.XXMaxPermSize
512m

I recommend 256m if you have 2g or 4g of real memory, or 512m if you have more. Next, the minimum memory option, set with this line (must appear after -vmargs):

-Xms512m

I recommend this be set to the same thing as your max perm size option. Finally, there's the option that controls the total amount of memory that Eclipse will be able to use, set on this line (must appear after -vmargs):

-Xmx2g

I recommend this be set to 1g if you have 2-4g of real memory, and 2g if you have more.

Save the file and restart Eclipse. You may have to adjust the settings up or down to find the optimum value for your system, but the recommendations above are a good starting point.

like image 170
Ed Burnette Avatar answered Sep 19 '22 19:09

Ed Burnette