What are the best JVM settings for Eclipse? -
what best jvm settings have found running eclipse?
it time of year again: "eclipse.ini take 3" settings strike back!
eclipse helios 3.6 , 3.6.x settings
alt text http://www.eclipse.org/home/promotions/friends-helios/helios.png
after settings eclipse ganymede 3.4.x , eclipse galileo 3.5.x, here in-depth @ "optimized" eclipse.ini settings file eclipse helios 3.6.x:
- based on runtime options,
- and using sun-oracle jvm 1.6u21 b7, released july, 27th (
some sun proprietary options may involved).
(by "optimized", mean able run full-fledge eclipse on our crappy workstation @ work, old p4 2002 2go ram , xpsp3. have tested same settings on windows7)
eclipse.ini
warning: non-windows platform, use sun proprietary option -xx:maxpermsize
instead of eclipse proprietary option --launcher.xxmaxpermsize
.
is: unless using latest jdk6u21 build 7. see 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 p2.reconciler.dropins.directory
external directory of choice.
see so answer. idea able drop new plugins in directory independently eclipse installation.
the following sections detail in eclipse.ini
file.
the dreaded oracle jvm 1.6u21 (pre build 7) , eclipse crashes
andrew niefer did alert me situation, , wrote blog post, non-standard vm argument (-xx:maxpermsize
) , can cause vms other vendors not start @ all.
eclipse version of option (--launcher.xxmaxpermsize
) not working new jdk (6u21, unless using 6u21 build 7, see below).
the final solution on eclipse wiki, , for helios on windows 6u21 pre build 7 only:
- downloading fixed eclipse_1308.dll (july 16th, 2010)
- and place into
(eclipse_home)/plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.0.v20100503
that's it. no setting tweak here (again, helios on windows 6u21 pre build 7).
non-windows platform, need revert sun proprietary option -xx:maxpermsize
.
the issue based 1 regression: jvm identification fails due oracle rebranding in java.exe, , triggered bug 319514 on eclipse.
andrew took care of bug 320005 - [launcher] --launcher.xxmaxpermsize: issunvm
should return true oracle, helios 3.6.1.
francis upton, eclipse committer, reflects on situation.
update u21b7, july, 27th:
oracle have regressed change next java 6 release , won't implement again until jdk 7.
if use jdk6u21 build 7, can revert --launcher.xxmaxpermsize
(eclipse option) instead of -xx:maxpermsize
(the non-standard option).
auto-detection happening in c launcher shim eclipse.exe
still "sun microsystems
" string, 6u21b7, work - again.
for now, still keep -xx:maxpermsize
version (because have no idea when launch eclipse right jdk).
implicit `-startup` , `--launcher.library`
contrary previous settings, exact path modules not set anymore, convenient since can vary between different eclipse 3.6.x releases:
- startup: if not specified, executable in plugins directory
org.eclipse.equinox.launcher
bundle highest version. - launcher.library: if not specified, executable looks in
plugins
directory appropriateorg.eclipse.equinox.launcher.[platform]
fragment highest version , uses shared library namedeclipse_*
inside.
use jdk6
the jdk6 explicitly required launch eclipse:
-dosgi.requiredjavaversion = 1.6
this so question reports positive incidence development on mac os.
+unlockexperimentalvmoptions
the following options part of of experimental options of sun jvm.
-xx:+unlockexperimentalvmoptions -xx:+useg1gc -xx:+usefastaccessormethods
they have been reported in blog post potentially speed eclipse.
see jvm options here , in official java hotspot options page.
note: detailed list of options reports usefastaccessormethods
might active default.
see "update jvm":
as reminder, g1 new garbage collector in preparation jdk 7, used in version 6 release u17.
opening files in eclipse command line
see blog post andrew niefer reporting new option:
--launcher.defaultaction openfile
this tells launcher if called command line contains arguments don't start "
-
", arguments should treated if followed "--launcher.openfile
".
eclipse myfile.txt
this kind of command line launcher receive on windows when double click file associated eclipse, or select files , choose "
open with
" or "send to
" eclipse.relative paths resolved first against current working directory, , second against eclipse program directory.
see bug 301033 reference. bug 4922 (october 2001, fixed 9 years later).
p2 , unsigned dialog prompt
if tired of dialog box during installation of many plugins:
, add in eclipse.ini
:
-declipse.p2.unsignedpolicy=allow
see blog post chris aniszczy, , bug report 235526.
i want security research supports fact less prompts better.
people ignore things pop in flow of want done.for 3.6, should not pop warnings in middle of flow - no matter how simplify, people ignore them.
instead, should collect problems, not install bundles problems, , instead bring user point in workflow can fixup - add trust, configure security policy more loosely, etc. 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 not directly in eclipse.ini
above, can come in handy if needed.
the `user.home` issue on windows7
when eclipse starts, read keystore file (where passwords kept), file located in user.home
.
if reason user.home
doesn't resolve full-fledge path, eclipse won't start.
raised in this question, if experience this, need redefine keystore file explicit path (no more user.home resolve @ start)
add in eclipse.ini
:
-eclipse.keyring c:\eclipse\keyring.txt
this has been tracked bug 300577, has been solve in other question.
debug mode
wait, there's more 1 setting file in eclipse.
if add eclipse.ini
option:
-debug
, enable debug mode , eclipse another setting file: .options
file can specify osgi options.
, great when adding new plugins through dropins folder.
add in .options file following settings, described in blog post "dropins diagnosis":
org.eclipse.equinox.p2.core/debug=true org.eclipse.equinox.p2.core/reconciler=true
p2 inform bundles found in
dropins/
folder, request generated, , plan of installation. maybe not detailed explanation of happened, , went wrong, should give strong information start:
- was bundle in plan?
- was installation problem (p2 fault)
- or maybe not optimal include feature?
that comes bug 264924 - [reconciler] no diagnosis of dropins problems, solves following issue like:
unzip eclipse-sdk-3.5m5-win32.zip ..../eclipse unzip mdt-ocl-sdk-1.3.0m5.zip ..../eclipse/dropins/mdt-ocl-sdk-1.3.0m5
this problematic configuration since ocl depends on emf missing.
3.5m5 provides no diagnosis of problem.start eclipse.
no obvious problems. nothing in error log.
help / / plugin
details showsorg.eclipse.ocl.doc
, notorg.eclipse.ocl
.help / / configuration
details has no (diagnostic) mention oforg.eclipse.ocl
.help / installation / information installed software
has no mention oforg.eclipse.ocl
.where nice error markers?
manifest classpath
see blog post:
- in galileo (aka eclipse 3.5), jdt started resolving manifest classpath in libraries added project’s build path. worked whether library added project’s build path directly or via classpath container, such user library facility provided jdt or 1 implemented third party.
- in helios, behavior changed exclude classpath containers manifest classpath resolution.
that means of projects might no longer compile in helios.
if want revert galileo behavior, add:
-dresolvereferencedlibrariesforcontainers=true
see bug 305037, bug 313965 , bug 313890 references.
ipv4 stack
this so question mentions potential fix when not accessing plugin update sites:
-djava.net.preferipv4stack=true
mentioned here in case in configuration.
jvm1.7x64 potential optimizations
this article reports:
for record, fastest options have found far bench test 1.7 x64 jvm n windows are:
-xincgc -xx:-dontcompilehugemethods -xx:maxinlinesize=1024 -xx:freqinlinesize=1024
but still working on it...
Comments
Post a Comment