What are the best JVM settings for Eclipse? [closed]
Asked Answered
B

16

315

What are the best JVM settings you have found for running Eclipse?

Burschenschaft answered 26/9, 2008 at 22:28 Comment(5)
The new and improved eclipse.ini settings for Helios 3.6 are here (below, in a new answer): #142857Brewton
It is amazing that the question closed as not constructive has such a high rating...Parasol
This question was asked when the most recent answer to a question like this in 2008 was eclipsezone.com/eclipse/forums/t20732.html. The answer set has grown because new versions of eclipse and java have been released, subsequent updates have kept the answers fresh. Closing the question will result in the answers becoming stale. The only way I can think of to rephrase this question would be to make it version specific, which I think is worse as it would cause multiple questions to answer basically the same problemBurschenschaft
Agree - closing questions like this is madness - madness I tell you - questions like this are the most useful and interesting on the site!Holley
According to reason for closure, "We expect answers to generally involve facts, references, or specific expertise". I think that closing this question is a stretch. Let us be careful using the censorship powers. I'd say that in case of doubt, it is better to "let the knowledge to be free" and open.Gilder
B
314

It is that time of year again: "eclipse.ini take 3" the settings strike back!

Eclipse Helios 3.6 and 3.6.x settings

alt text http://www.eclipse.org/home/promotions/friends-helios/helios.png

After settings for Eclipse Ganymede 3.4.x and Eclipse Galileo 3.5.x, here is an in-depth look at an "optimized" eclipse.ini settings file for Eclipse Helios 3.6.x:

(by "optimized", I mean able to run a full-fledge Eclipse on our crappy workstation at work, some old P4 from 2002 with 2Go RAM and XPSp3. But I have also tested those same settings on Windows7)

Eclipse.ini

alt text

WARNING: for non-windows platform, use the Sun proprietary option -XX:MaxPermSize instead of the Eclipse proprietary option --launcher.XXMaxPermSize.
That is: Unless you are using the latest jdk6u21 build 7. See the Oracle section below.

-data
../../workspace
-showlocation
-showsplash
org.eclipse.platform
--launcher.defaultAction
openFile
-vm
C:/Prog/Java/jdk1.6.0_21/jre/bin/server/jvm.dll
-vmargs
-Dosgi.requiredJavaVersion=1.6
-Declipse.p2.unsignedPolicy=allow
-Xms128m
-Xmx384m
-Xss4m
-XX:PermSize=128m
-XX:MaxPermSize=384m
-XX:CompileThreshold=5
-XX:MaxGCPauseMillis=10
-XX:MaxHeapFreeRatio=70
-XX:+CMSIncrementalPacing
-XX:+UnlockExperimentalVMOptions
-XX:+UseG1GC
-XX:+UseFastAccessorMethods
-Dcom.sun.management.jmxremote
-Dorg.eclipse.equinox.p2.reconciler.dropins.directory=C:/Prog/Java/eclipse_addons

Note:
Adapt the p2.reconciler.dropins.directory to an external directory of your choice.
See this SO answer. The idea is to be able to drop new plugins in a directory independently from any Eclipse installation.

The following sections detail what are in this eclipse.ini file.


The dreaded Oracle JVM 1.6u21 (pre build 7) and Eclipse crashes

Andrew Niefer did alert me to this situation, and wrote a blog post, about a non-standard vm argument (-XX:MaxPermSize) and can cause vms from other vendors to not start at all.
But the eclipse version of that option (--launcher.XXMaxPermSize) is not working with the new JDK (6u21, unless you are using the 6u21 build 7, see below).

The final solution is on the Eclipse Wiki, and for Helios on Windows with 6u21 pre build 7 only:

(eclipse_home)/plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.0.v20100503

That's it. No setting to tweak here (again, only for Helios on Windows with a 6u21 pre build 7).
For non-Windows platform, you need to revert to the Sun proprietary option -XX:MaxPermSize.

The issue is based one a regression: JVM identification fails due to Oracle rebranding in java.exe, and triggered bug 319514 on Eclipse.
Andrew took care of Bug 320005 - [launcher] --launcher.XXMaxPermSize: isSunVM should return true for Oracle, but that will be only for Helios 3.6.1.
Francis Upton, another Eclipse committer, reflects on the all situation.

Update u21b7, July, 27th:
Oracle have regressed the change for the next Java 6 release and won't implement it again until JDK 7.
If you use jdk6u21 build 7, you can revert to the --launcher.XXMaxPermSize (eclipse option) instead of -XX:MaxPermSize (the non-standard option).
The auto-detection happening in the C launcher shim eclipse.exe will still look for the "Sun Microsystems" string, but with 6u21b7, it will now work - again.

For now, I still keep the -XX:MaxPermSize version (because I have no idea when everybody will launch eclipse the right JDK).


Implicit `-startup` and `--launcher.library`

Contrary to the previous settings, the exact path for those modules is not set anymore, which is convenient since it can vary between different Eclipse 3.6.x releases:

  • startup: If not specified, the executable will look in the plugins directory for the org.eclipse.equinox.launcher bundle with the highest version.
  • launcher.library: If not specified, the executable looks in the plugins directory for the appropriate org.eclipse.equinox.launcher.[platform] fragment with the highest version and uses the shared library named eclipse_* inside.

Use JDK6

The JDK6 is now explicitly required to launch Eclipse:

-Dosgi.requiredJavaVersion = 1.6

This SO question reports a positive incidence for development on Mac OS.


+UnlockExperimentalVMOptions

The following options are part of some of the experimental options of the Sun JVM.

-XX:+UnlockExperimentalVMOptions
-XX:+UseG1GC
-XX:+UseFastAccessorMethods

They have been reported in this blog post to potentially speed up Eclipse.
See all the JVM options here and also in the official Java Hotspot options page.
Note: the detailed list of those options reports that UseFastAccessorMethods might be active by default.

See also "Update your JVM":

As a reminder, G1 is the new garbage collector in preparation for the JDK 7, but already used in the version 6 release from u17.


Opening files in Eclipse from the command line

See the blog post from Andrew Niefer reporting this new option:

--launcher.defaultAction
openFile

This tells the launcher that if it is called with a command line that only contains arguments that don't start with "-", then those arguments should be treated as if they followed "--launcher.openFile".

eclipse myFile.txt

This is the kind of command line the launcher will receive on windows when you double click a file that is associated with eclipse, or you select files and choose "Open With" or "Send To" Eclipse.

Relative paths will be resolved first against the current working directory, and second against the eclipse program directory.

See bug 301033 for reference. Originally bug 4922 (October 2001, fixed 9 years later).


p2 and the Unsigned Dialog Prompt

If you are tired of this dialog box during the installation of your many plugins:

alt text

, add in your eclipse.ini:

-Declipse.p2.unsignedPolicy=allow

See this blog post from Chris Aniszczy, and the bug report 235526.

I do want to say that security research supports the fact that less prompts are better.
People ignore things that pop up in the flow of something they want to get done.

For 3.6, we should not pop up warnings in the middle of the flow - no matter how much we simplify, people will just ignore them.
Instead, we should collect all the problems, do not install those bundles with problems, and instead bring the user back to a point in the workflow where they can fixup - add trust, configure security policy more loosely, etc. This is called 'safe staging'.

---------- http://www.eclipse.org/home/categories/images/wiki.gif alt text http://www.eclipse.org/home/categories/images/wiki.gif alt text http://www.eclipse.org/home/categories/images/wiki.gif

Additional options

Those options are not directly in the eclipse.ini above, but can come in handy if needed.


The `user.home` issue on Windows7

When eclipse starts, it will read its keystore file (where passwords are kept), a file located in user.home.
If for some reason that user.home doesn't resolve itself properly to a full-fledge path, Eclipse won't start.
Initially raised in this SO question, if you experience this, you need to redefine the keystore file to an explicit path (no more user.home to resolve at the start)

Add in your eclipse.ini:

-eclipse.keyring 
C:\eclipse\keyring.txt

This has been tracked by bug 300577, it has been solve in this other SO question.


Debug mode

Wait, there's more than one setting file in Eclipse.
if you add to your eclipse.ini the option:

-debug

, you enable the debug mode and Eclipse will look for another setting file: a .options file where you can specify some OSGI options.
And that is great when you are adding new plugins through the dropins folder.
Add in your .options file the following settings, as described in this blog post "Dropins diagnosis":

org.eclipse.equinox.p2.core/debug=true
org.eclipse.equinox.p2.core/reconciler=true

P2 will inform you what bundles were found in dropins/ folder, what request was generated, and what is the plan of installation. Maybe it is not detailed explanation of what actually happened, and what went wrong, but it should give you strong information about where to start:

  • was your bundle in the plan?
  • Was it installation problem (P2 fault)
  • or maybe it is just not optimal to include your feature?

That comes from Bug 264924 - [reconciler] No diagnosis of dropins problems, which finally solves the following issue like:

Unzip eclipse-SDK-3.5M5-win32.zip to ..../eclipse
Unzip mdt-ocl-SDK-1.3.0M5.zip to ..../eclipse/dropins/mdt-ocl-SDK-1.3.0M5

This is a problematic configuration since OCL depends on EMF which is missing.
3.5M5 provides no diagnosis of this problem.

Start eclipse.
No obvious problems. Nothing in Error Log.

  • Help / About / Plugin details shows org.eclipse.ocl.doc, but not org.eclipse.ocl.
  • Help / About / Configuration details has no (diagnostic) mention of org.eclipse.ocl.
  • Help / Installation / Information Installed Software has no mention of org.eclipse.ocl.

Where are the nice error markers?


Manifest Classpath

See this blog post:

  • In Galileo (aka Eclipse 3.5), JDT started resolving manifest classpath in libraries added to project’s build path. This worked whether the library was added to project’s build path directly or via a classpath container, such as the user library facility provided by JDT or one implemented by a third party.
  • In Helios, this behavior was changed to exclude classpath containers from manifest classpath resolution.

That means some of your projects might no longer compile in Helios.
If you want to revert to Galileo behavior, add:

-DresolveReferencedLibrariesForContainers=true

See bug 305037, bug 313965 and bug 313890 for references.


IPV4 stack

This SO question mentions a potential fix when not accessing to plugin update sites:

-Djava.net.preferIPv4Stack=true

Mentioned here just in case it could help in your configuration.


JVM1.7x64 potential optimizations

This article reports:

For the record, the very fastest options I have found so far for my bench test with the 1.7 x64 JVM n Windows are:

-Xincgc 
-XX:-DontCompileHugeMethods 
-XX:MaxInlineSize=1024  
-XX:FreqInlineSize=1024 

But I am still working on it...

Brewton answered 18/7, 2010 at 13:23 Comment(18)
As per this link, oracle.com/technetwork/java/javase/gc-tuning-6-140523.html#icms, you need to have -XX:+UseConcMarkSweepGC in order to use -XX:+CMSIncrementalMode. That is missing from your example above. We would not need CMSIncrementalMode in case we use G1 GC, am I right?Broth
@Satish: I believe you are right. I will test those two configurations separately and update accordingly.Brewton
Hey, G1GC is a disaster on a mac. It eats the entire machine, requiring a reboot.Irrelevant
@bmargulies: interesting, what is your exact configuration? (Os version, memory?)Brewton
2.8GHz core duo 2, 8GB memory, 10.6.5. Works find without the G1GC options, eats the whole machine and hangs with them. Using m2eclipse with many projects in the workspace. -Xmx1g.Irrelevant
-Xss4m is a dangerous option - at least on windows. It caused an java.lang.OutOfMemoryError: unable to create new native thread error after using eclipse for less than 10 minutes.Morez
@MRalwasser: Interesting: I will make some tests (I didn't experienced that on our 6-8 years old workstations as well as our more recent PC), and will take that into account for Indigo (3.7). What JDK are you using for launching your Eclipse? (I presume Eclipse 3.6.x)Brewton
@VonC: I saw this error while using Oracle JDK 6.0 Update 24, Eclipse 3.6.2 JEE bundle, Windows XP.Morez
@Brewton : -XX:CompileThreshold=5 causes HORRENDOUS slowdowns for me. Getting rid of this option alone cut my Eclipse startup time down to 17 secs from >1 min!! Not to mention how terribly slow the IDE was in general. See this linkShontashoo
@TrinitronX: good point, I am preparing the next set of options for Indigo, and I will document the removal of that option based on your feedback and link. Thank you.Brewton
@Shontashoo : (and actually everyone), -XX:CompileThreshold=5 is a very low value (default=10000). This value represents the number of method invocations/branches before compiling it. Too low a value will cause your CodeCache to fill up prematurely and the Console may report: CodeCache is full. Compiler has been disabled Once the Compiler is disabled you will notice slowness in the app. There are two ways to fix this, 1. Use -XX:CompileThreshold=1000 (fine tune this number) or 2. Try increasing the code cache size using -XX:ReservedCodeCacheSize=64m (double from the default 32m)Nicaea
I think adding -server after -vmargs and removing the -vm setting results in the same thing with less typingDistraint
for linux use /usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/i386/client/libjvm.so for jvm locationCureall
blogs.sun.com/watt/resource/jvm-options-list.html is a dead linkCreosol
@Shurane: oracle.com/technetwork/java/javase/tech/… should be the new addresses. I will update the post soon.Brewton
Any update for Eclipse 3.7? How relevant are these settings for OpenJDK 7?Beamy
@tlvince: I have only a few minor updates, but only for JDK6. I wouldn't risk using a JDK7 for launching Eclipse right now: some bugs remain.Brewton
for openjdk on linux amd64, I use /usr/lib/jvm/java-6-openjdk/jre/lib/amd64/server/libjvm.soRosemaria
B
76

Eclipse Galileo 3.5 and 3.5.1 settings

Currently (November 2009), I am testing with jdk6 update 17 the following configuration set of options (with Galileo -- eclipse 3.5.x, see below for 3.4 or above for Helios 3.6.x):
(of course, adapt the relative paths present in this eclipse.ini to the correct paths for your setup)

Note: for eclipse3.5, replace startup and launcher.library lines by:

-startup
plugins/org.eclipse.equinox.launcher_1.0.200.v20090520.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.0.200.v20090519

eclipse.ini 3.5.1

-data
../../workspace
-showlocation
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
384m
-startup
plugins/org.eclipse.equinox.launcher_1.0.201.R35x_v20090715.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.0.200.v20090519
-vm
../../../../program files/Java/jdk1.6.0_17/jre/bin/client/jvm.dll
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms128m
-Xmx384m
-Xss4m
-XX:PermSize=128m
-XX:MaxPermSize=384m
-XX:CompileThreshold=5
-XX:MaxGCPauseMillis=10
-XX:MaxHeapFreeRatio=70
-XX:+UseConcMarkSweepGC
-XX:+CMSIncrementalMode
-XX:+CMSIncrementalPacing
-Dcom.sun.management.jmxremote
-Dorg.eclipse.equinox.p2.reconciler.dropins.directory=C:/jv/eclipse/mydropins

See also my original answer above for more information.

Changes (from July 2009)

  • refers to the launcher and not the framework
  • shared plugins: org.eclipse.equinox.p2.reconciler.dropins.directory option.
  • Galileo supports fully relative paths for workspace or VM (avoid having to modify those from one eclipse installation to another, if, of course, your JVM and workspace stay the same)
    Before, those relative paths kept being rewritten into absolute ones when eclipse launched itself...
  • You also can copy the JRE directory of a Java JDK installation inside your eclipse directory

Caveats

There was a bug with ignored breakpoints actually related to the JDK.
Do use JDK6u16 or more recent for launching eclipse (You can then define as many JDKs you want to compile within eclipse: it is not because you launch an eclipse with JDK6 that you will have to compile with that same JDK).

Max

Note the usage of:

--launcher.XXMaxPermSize
384m
-vmargs
-XX:MaxPermSize=128m

As documented in the Eclipse Wiki,

Eclipse 3.3 supports a new argument to the launcher: --launcher.XXMaxPermSize.
If the VM being used is a Sun VM and there is not already a -XX:MaxPermSize= VM argument, then the launcher will automatically add -XX:MaxPermSize=256m to the list of VM arguments being used.
The 3.3 launcher is only capable of identifying Sun VMs on Windows.

As detailed in this entry:

Not all vms accept the -XX:MaxPermSize argument which is why it is passed in this manner. There may (or may not) exist problems with identifying sun vms.
Note: Eclipse 3.3.1 has a bug where the launcher cannot detect a Sun VM, and therefore does not use the correct PermGen size. It seems this may have been a known bug on Mac OS X for 3.3.0 as well.
If you are using either of these platform combination, add the -XX flag to the eclipse.ini as described above.

Notes:

  • the "384m" line translates to the "=384m" part of the VM argument, if the VM is case sensitive on the "m", then the so is this argument.
  • the "--launcher." prefix, this specifies that the argument is consumed by the launcher itself and was added to launcher specific arguments to avoid name collisions with application arguments. (Other examples are --launcher.library, --launcher.suppressErrors)

The -vmargs -XX:MaxPermSize=384m part is the argument passed directly to the VM, bypassing the launcher entirely and no check on the VM vendor is used.

Brewton answered 11/9, 2009 at 8:1 Comment(8)
I had a couple problems with this for the latest eclipse 3.5x64 release: --launcher.library plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.0.200.v20090519 -startup plugins/org.eclipse.equinox.launcher_1.0.200.v20090520.jar also I had to use a jdk JAVA_HOME/bin/javaw, for the m2eclipse plugin. Otherwise this is crazy awesome.Toogood
Aren't these two doing the same thing? "--launcher.XXMaxPermSize 384m" and "-XX:MaxPermSize=128m"Carbrey
@Igor Zinov'yev: it is a bit redundant, but both can be useful, depending on the platform and eclipse version. I reset them to the same value, and completed my answer with a bit of documentation regarding those settings.Brewton
See also #2204673Brewton
If you always want to use the latest and greatest VM then why isn't the argument "-Dosgi.requiredJavaVersion=1.5" using 1.6?Mullens
@Tony: I left it here because some of my user weren't always using a JRE6 for running eclipse. For Helios (3.6) I will publish an updated answer with 1.6 for osgi.requiredJavaVersionBrewton
@VonC, Java 6 update 21 reintroduces the permgen problems because the jvm vendor changed from Sun to Oracle. aniefer.blogspot.com/2010/07/…Guesswarp
@Andrew: duly noted. Eclipse Helios settings answer is coming up this next week-endBrewton
B
63

Eclipse Ganymede 3.4.2 settings


For more recent settings, see Eclipse Galileo 3.5 settings above.


JDK

The best JVM setting always, in my opinion, includes the latest JDK you can find (so for now, jdk1.6.0_b07 up to b16, except b14 and b15)

eclipse.ini

Even with those pretty low memory settings, I can run large java projects (along with a web server) on my old (2002) desktop with 2Go RAM.

-showlocation
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256M
-framework
plugins\org.eclipse.osgi_3.4.2.R34x_v20080826-1230.jar
-vm
jdk1.6.0_10\jre\bin\client\jvm.dll
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms128m
-Xmx384m
-Xss2m
-XX:PermSize=128m
-XX:MaxPermSize=128m
-XX:MaxGCPauseMillis=10
-XX:MaxHeapFreeRatio=70
-XX:+UseConcMarkSweepGC
-XX:+CMSIncrementalMode
-XX:+CMSIncrementalPacing
-XX:CompileThreshold=5
-Dcom.sun.management.jmxremote

See GKelly's SO answer and Piotr Gabryanczyk's blog entry for more details about the new options.

Monitoring

You can also consider launching:

C:\[jdk1.6.0_0x path]\bin\jconsole.exe

As said in a previous question about memory consumption.

Brewton answered 27/9, 2008 at 20:0 Comment(8)
what is -Xssv2m for, when i include it in the vm settings eclipse wont launch, had a look at the docs for JVM settings but couldn't find itBurschenschaft
Right... that was a typo: Xss2m, not Xssv2m: -Xss determines the size of the stack: -Xss1024k. If the stack space is too small, eventually you will see an exception class java.lang.StackOverflowError (a mythic error message around here ;-) )Brewton
Finally got round to using the second set of settings and amazed at how well they work!Burschenschaft
Have had a chance to use the settings for a while now, eclipse seems snappy, but doing ant builds seems slower???Burschenschaft
@Craig Angus: strange, what version of eclipse are you using ? And which ant version is included in it ?Brewton
@VonC: 3.5M5 older antVersion from 3.4, cant verify yet as not currently developing using eclipse on regular enough basisBurschenschaft
@Craig: ok I will check those settings with my eclipse3.5M5 at home this week-end (I only use 3.4 at work)Brewton
jdk6_u16 contains a fix for ignored breakpointsOrose
D
20

Eclipse Indigo 3.7.2 settings (64 bit linux)

Settings for Sun/Oracle java version "1.6.0_31" and Eclipse 3.7 running on x86-64 Linux:

-nosplash
-vmargs
-Xincgc
-Xss500k
-Dosgi.requiredJavaVersion=1.6
-Xms64m
-Xmx200m
-XX:NewSize=8m
-XX:PermSize=80m
-XX:MaxPermSize=150m
-XX:MaxPermHeapExpansion=10m
-XX:+UseConcMarkSweepGC
-XX:CMSInitiatingOccupancyFraction=70
-XX:+UseCMSInitiatingOccupancyOnly
-XX:+UseParNewGC
-XX:+CMSConcurrentMTEnabled
-XX:ConcGCThreads=2
-XX:ParallelGCThreads=2
-XX:+CMSIncrementalPacing
-XX:CMSIncrementalDutyCycleMin=0
-XX:CMSIncrementalDutyCycle=5
-XX:GCTimeRatio=49
-XX:MaxGCPauseMillis=20
-XX:GCPauseIntervalMillis=1000
-XX:+UseCMSCompactAtFullCollection
-XX:+CMSClassUnloadingEnabled
-XX:+DoEscapeAnalysis
-XX:+UseCompressedOops
-XX:+AggressiveOpts
-XX:+ExplicitGCInvokesConcurrentAndUnloadsClasses

Note that this uses only 200 MB for the heap and 150 MB for the non-heap. If you're using huge plugins, you might want to increase both the "-Xmx200m" and "-XX:MaxPermSize=150m" limits.

The primary optimization target for these flags has been to minimize latency in all cases and as a secondary optimization target minimize the memory usage.

Dvorak answered 19/10, 2011 at 13:36 Comment(7)
Works fantastically for me (though I doubled the values for the memory related settings, it's still low and blistering fast!)Bistre
You have both -XX:+UseConcMarkSweepGC and -XX:+UseParNewGC. Why? I don't think you can use both garbage collectors, and I'm not sure which one finally gets used.Bargainbasement
I thought that -XX:+UseConcMarkSweepGC is for old generation garbage collection and -XX:+UseParNewGC is used for eden garbage collection.Dvorak
See also: blogs.oracle.com/jonthecollector/entry/our_collectorsDvorak
Each option and each argument to an option must be on its own line.Entreat
@JoshClemm Only if you put those settings to eclipse.ini. I'm calling executable file eclipse with these command line parameters and you must not use line feeds there.Dvorak
SSD with 16 Gigs of RAM. Set "-Xmx4G" and "-XX:MaxPermSize=3G. Runs like a dream.Overload
O
14

-showlocation

To make it easier to have eclipse running twice, and know which workspace you're dealing with

Eclipse 3.6 adds a preferences option to specify what to show for the Workspace name (shown in window title) which works much better than -showlocation for three reasons:

  1. You do not need to restart eclipse for it to take affect.
  2. You can chose a short code.
  3. It appears first, before the perspective and application name.
Orose answered 27/9, 2008 at 0:22 Comment(0)
P
9

If you are using Linux + Sun JDK/JRE 32bits, change the "-vm" to:

-vm 
[your_jdk_folder]/jre/lib/i386/client/libjvm.so

If you are using Linux + Sun JDK/JRE 64bits, change the "-vm" to:

-vm
[your_jdk_folder]/jre/lib/amd64/server/libjvm.so

That's working fine for me on Ubuntu 8.10 and 9.04

Popularly answered 14/12, 2008 at 3:13 Comment(2)
Is this to have Eclipse using a JDK as the default environment?Holton
This can be used to have Eclipse using a specific/different JDK as the default environment.Popularly
T
9

If you're going with jdk6 update 14, I'd suggest using using the G1 garbage collector which seems to help performance.

To do so, remove these settings:

-XX:+UseConcMarkSweepGC
-XX:+CMSIncrementalMode
-XX:+CMSIncrementalPacing

and replace them with these:

-XX:+UnlockExperimentalVMOptions
-XX:+UseG1GC

Tightrope answered 7/7, 2009 at 19:58 Comment(0)
T
7

You can also try running with JRockit. It's a JVM optimized for servers, but many long running client applications, like IDE's, run very well on JRockit. Eclipse is no exception. JRockit doesn't have a perm-space so you don't need to configure it.

It's possible set a pause time target(ms) to avoid long gc pauses stalling the UI.

-showsplash
org.eclipse.platform
-vm
 C:\jrmc-3.1.2-1.6.0\bin\javaw.exe 
-vmargs
-XgcPrio:deterministic
-XpauseTarget:20

I usually don't bother setting -Xmx and -Xms and let JRockit grow the heap as it sees necessary. If you launch your Eclipse application with JRockit you can also monitor, profile and find memory leaks in your application using the JRockit Mission Control tools suite. You download the plugins from this update site. Note, only works for Eclipse 3.3 and Eclipse 3.4

Tenement answered 3/12, 2009 at 6:20 Comment(1)
I have ran eclipse on JRockit in the past and ran very wellBurschenschaft
C
5

Here's my own setting for my Eclipse running on i7 2630M 16GB RAM laptop, this setting has been using for a week, without a single crashing, and Eclipse 3.7 is running smoothly.

-startup
plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.100.v20110502
-product
org.eclipse.epp.package.jee.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms1024m
-Xmx4096m 
-XX:MaxPermSize=256m

Calculations: For Win 7 x64

  • Xms = Physical Memory / 16
  • Xmx = Physical Memory / 4
  • MaxPermSize = Same as default value, which is 256m
Comp answered 23/9, 2011 at 3:11 Comment(1)
Wow 16G laptop? I'm curious. Is that a System76? :DCalico
J
5
-startup
../../../plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
--launcher.library
../../../plugins/org.eclipse.equinox.launcher.cocoa.macosx_1.1.100.v20110502
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vmargs
-Xms128m
-Xmx512m
-XX:MaxPermSize=256m
-Xdock:icon=../Resources/Eclipse.icns
-XstartOnFirstThread
-Dorg.eclipse.swt.internal.carbon.smallFonts
-Dcom.sun.management.jmxremote
-Declipse.p2.unsignedPolicy=allow

And these setting have worked like a charm for me. I am running OS X10.6 , Eclipse 3.7 Indigo , JDK1.6.0_24

Jayejaylene answered 15/10, 2011 at 7:59 Comment(1)
Thanks, this helped out my performance quite a bit (similar setup). But I bumped up max heap size to 1024MB.Tallahassee
V
4

My own settings (Java 1.7, modify for 1.6):

-vm
C:/Program Files (x86)/Java/jdk1.7.0/bin
-startup
plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.100.v20100628
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vmargs
-server
-Dosgi.requiredJavaVersion=1.7
-Xmn100m
-Xss1m
-XgcPrio:deterministic
-XpauseTarget:20
-XX:PermSize=400M
-XX:MaxPermSize=500M
-XX:CompileThreshold=10
-XX:MaxGCPauseMillis=10
-XX:MaxHeapFreeRatio=70
-XX:+UnlockExperimentalVMOptions
-XX:+DoEscapeAnalysis
-XX:+UseG1GC
-XX:+UseFastAccessorMethods
-XX:+AggressiveOpts
-Xms512m
-Xmx512m
Vowelize answered 18/7, 2010 at 17:46 Comment(0)
M
3

Eclipse likes lots of RAM. Use at least -Xmx512M. More if available.

Myocardium answered 27/9, 2008 at 0:14 Comment(0)
T
3

If youre like me and had problems with the current Oracle release of 1.6 then you might want to update your JDK or set

-XX:MaxPermSize
. More information is available here: http://java.dzone.com/articles/latest-java-update-fixes
Tyra answered 28/7, 2010 at 16:12 Comment(0)
L
2

XX:+UseParallelGC that's the most awesome option ever!!!

Lamrouex answered 7/10, 2009 at 4:7 Comment(0)
O
1

-vm
C:\Program Files\Java\jdk1.6.0_07\jre\bin\client\jvm.dll

To specify which java version you are using, and use the dll instead of launching a javaw process

Orose answered 27/9, 2008 at 0:21 Comment(0)
S
0

Here's what I use (though I have them in the shortcut instead of the settings file):

eclipse.exe -showlocation -vm "C:\Java\jdk1.6.0_07\bin\javaw.exe" -vmargs -Xms256M -Xmx768M -XX:+UseParallelGC -XX:MaxPermSize=128M

Seethrough answered 26/9, 2008 at 22:38 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.