This post originated from an RSS feed registered with Java Buzz
by Fred Grott.
Original Post: Eclipse Ini Tunning
Feed Title: GrottWorkShop
Feed URL: http://shareme.github.io/atom.xml
Feed Description: Android development with a passion for Android, Java, and Agile.
Part of being a new android developer is that imersion in using Eclipse and not all the information is easy to find. To fine tune the speed of Eclipse you have to modfiy and add some options to the Eclipse INI file. So lets get you up to speed in completing that task.
A typical Eclipse INI file
A typical Eclipse IDE INI file looks something like this:
Turn off Virus scanning of Workspace dirs
This is really true if you are on MS Windows, run off virus scanning on all your workspace directories and the Eclipse IDE installation folder.
JVM Version
Udating and using the newest JVM not only protects use as far as security holes but it alos gives us new options in GC. etc to tune and speed up Eclipse so lets update our JVM. After typing the
java -version
command in a terminal you should see the java version and if its not the most recent version than you need to install the most recent version.
VM Optons
Okay, before going wild with this backup a copy of your Eclipse INI file just in case you goof it up the first time. The first step is to make sure that since we will be using the latest VM options ot the latest JVM that is the JVM that Eclipse will boot up under.
D Options
Any time you see a
-D
option its a command to the JVM to pass on an option to the application and the application in this case is the Eclipse IDE itself. Thus:
-Dosgi.requiredJavaVersion=1.7
tells the Eclipse IDE OSGI component that only bootup Eclipse using the ini file using JVM 1.7 or higher. If you are on JVM 1.7 or higher change that like to mirror using 1.7 now.
Server option
The server option flag refers to which JVM client you are using either the default which is client or server. The option command to pu in the INI file is:
-server
insert it right after the vmargs flag.
Standard and Non-standard JVM options
Flags with X are standard JVM options and flags with XX are non-standard options. Generally you set most if not all the standard X flags first since you know that they are stable from major version of JVM to next major version of JVM.
Than you will set the non standard flags last and it helps if do a small subset at a time boot up eclipse and make sure that it runs.
X Memory options
Now lets set up the minimum and maximum start up JVM memory sizes that Eclipse IDE will use. Xms is minimum(physical ram size/16) and Xmx is maximum(physical ram size/4). Thus for 4 gigs of physical ram, for example on a Mac Laptop, you would have:
-Xms326m
-Xmx812m
You will always want tomake sure that the setting for Xmx plus XXMaxPermSize does not exceed your physical ram.
X new generation size
Xmn is the new generatin size flag and generally likes:
-Xmn128m
insert it right before your JVM X memory option settings.
X Thread stack size
Xss is the thread stack size setting flag and generallty you will set it to:
-Xss1m
insert it right after the Xmn setting.
X GC flag setting
Okay now its time to pick a GC to use. But before we get to that we need to the method that the GC will use. I am using deterministic: