Community
Participate
Working Groups
Build Identifier: I20110613-1736 Performance of Eclipse on Mac OS X is very bad when changing perspectives, opening java files, or maximizing the java editor to consume the entire IDE. This is a well known problem in the Mac community and has been around for a while, and I found a workaround here: http://www.inteist.com/2010/05/how-to-speed-up-eclipse-on-os-x-10-6-snow-leopard/ Basically all you need to do is add this line: -Dosgi.requiredJavaVersion=1.6 to eclipse/Eclipse.app/Contents/MacOS/eclipse.ini Could the default eclipse.ini be updated so Eclipse works well out of the box without having to tweak this? Reproducible: Always
John, who exactly decides the content of the eclipse.ini file? The PMC? The Launcher team?
Setting "osgi.requiredJavaVersion" will have no affect on performance. This property enforces a version check on the vm, and if the vm is not greater than or equal to that version then eclipse will exit with an error message: Incompatible JVM Version " + availableVersion + " of the JVM is not suitable for this product. Version: " + requiredVersion + " or greater is required. Presumably any performance increase is gained by using java 1.6 instead of 1.5, but this property will only cause eclipse to exit on 1.5 and doesn't do anything on its own to cause 1.6 to be used.
I could have sworn that this improved the performance for me, but now if I remove that setting I see no performance degradation. There must be something else going on. What I can tell you is that before I changed this (I also doubled -Xms and -Xmx to 80 and 1024 respectively) it was taking about 5 seconds to switch between perspectives or resize the editor window. After I changed the eclipse.ini file it is much snappier. When I searched for a way to improve the performance on Max OS X I found more than one post mentioning the -Dosgi.requiredJavaVersion=1.6. Is it even remotely possible that somehow touching this file may have caused Eclipse to suddenly use 1.6? I do have both 1.5 and 1.6 installed on my Mac (and boy was that a pain to setup) and 1.6 is the default, but I suppose it may be possible that somehow Eclipse was picking up 1.5 before.
Perhaps you downloaded the 32-bit version of Eclipse and that was slow. There is no 32-bit 1.6 VM available for the Mac so it is left with using the 32-bit Java 1.5 version. Then later you downloaded the 64-bit version and was allowed to use the faster 1.6 VM?
(In reply to comment #4) > Perhaps you downloaded the 32-bit version of Eclipse and that was slow. There > is no 32-bit 1.6 VM available for the Mac so it is left with using the 32-bit > Java 1.5 version. Then later you downloaded the 64-bit version and was allowed > to use the faster 1.6 VM? There used to at the begining but since then there is a 1.6 32bit Java! Simply run with -d32 and you have a 32bit java ;-)
OK, I figured out what happened. Turns out I downloaded an adopter product built on top of eclipse and the eclipse.ini in there had 1.5 specified; not sure where they got their eclipse.ini or why 1.5 is specified, but I'll follow up with them to get it fixed on their end. Thanks for the help. As far as I'm concerned this can be closed.
As an owner of the other product, I am confused about this entire premise. From this discussion, it looks like you doubled the memory and Eclipse ran faster, but you attribute the issue to the osgi flag?
Increasing the memory I can believe makes a difference. We increased it early in 3.6, but before that it was known to be bad on Mac Cocoa in particular (see bug 276523). A larger product may also want to go with higher memory settings than base Eclipse. Changing osgi.requiredJavaVersion will make absolutely no difference to performance. As Andrew said, all this flag does is compare the version to the currently running JRE at startup, and bail with an error if the version is too low.