Eclipse Indigo typing lag on OS X Lion - java

I am working on a fairly large project and have recently bumped into the good old friend of mine from the 90's, typing lag.
My setup is MacBook Pro 2.2 GHz i7 8GB with SSD drive and it hasn't had any serious performance issues so far.
I have increased the memory allocations to -Xmx1024m and -XX:MaxPermSize=512m. There is no heavy use of plugins involved. Also, this only happens on .java files in the default editor.
What could be the problem?
EDIT:
I found the problem. I noticed that the problem occurred only when editing large java files. In my case the class had 1800 rows.
It's weird though, since I am not facing the same problem with the same eclipse setup on Ubuntu. It seems like Eclipse on Mac just can't handle java files that big I was editing.
Any suggestions?
EDIT2:
I am using the Eclipse Indigo for Java EE with the latest updates (3.7.1.X)
Installed plugins:
m2eclipse
MercurialEclipse aka HGE (1.9.1 from the official eclipse update site)
Subclipse (installed, but not used in the workspace where the typing lag occurs)
ADT (installed, but not used in this project)
All plugins are installed via Eclipse marketplace and are updated to the latest release unless stated otherwise.

Try altering the settings in your eclipse.ini file. This contain the settings for the JVM and can help reduce memory issues like this.
Example eclipse.ini:
-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
Detailed in this question and this question.

Jivings was right about the root of the problem being in the eclipse.ini file.
I am not sure what I have actually changed in the eclipse.ini after messing around with the it, since the TimeMachine does not seem to be able to save a backup of the .ini file inside the Eclipse application package (Eclipse/Contents/MacOS/eclipse.ini).
I actually lowered the MaxPermSize and other memory values which made Eclipse run smoother. If anyone else is encountering the same problem, I suggest you try similar values and see if that works. If it doesn't, I also read that you can start eclipse once with the -clean argument, which cleans up some installation and usage history among other things. I did not do that, but it's worth a try.
The following is my current configuration, and it works pretty well:
-startup
../../../plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
--launcher.library
../../../plugins/org.eclipse.equinox.launcher.cocoa.macosx.x86_64_1.1.100.v20110502
-product
org.eclipse.epp.package.jee.product
--launcher.defaultAction
openFile
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vmargs
-Dosgi.requiredJavaVersion=1.5
-XstartOnFirstThread
-Dorg.eclipse.swt.internal.carbon.smallFonts
-XX:MaxPermSize=256m
-Xms40m
-Xmx512m
-Xdock:icon=../Resources/Eclipse.icns
-XstartOnFirstThread
-Dorg.eclipse.swt.internal.carbon.smallFonts

Related

Why my eclipse is running so slow

I don't know whats wrong with my eclipse. its running so slow.
it takes at least 10 minutes to open. when Start server it is also taking long time.I tried multiple way.
I am on Windows 7,
eclipse LUNA (4.4.0)
I am using maven and spring framework and running jboss server.
I have 8 GB of RAM.
my eclipse.ini look like that
-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20140415-2008.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.200.v20140603-1326
-product
org.eclipse.epp.package.jee.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
1024M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
1024m
--launcher.defaultAction
openFile
--launcher.appendVmargs
-vmargs
-Dosgi.requiredJavaVersion=1.6
-Xms1024m
-Xmx1024m
I have changed Xms and Xmx value from
-Xms128m
-Xmx128m
to this
-Xms1024m
-Xmx1024m
But I am having the same issue,
It was working fine but after few days it become slower and slower.
Please help.
Add -Xverify:none to your eclipse.ini file.
It will cut down your Eclipse startup time considerably.This will tell the VM not to validate all the .class files it is loading
try removing unwanted plugins from the eclipse.. since these plugins cause unnecessary memory consumption you will definitely see some improvement. I have faced this issue, after removing some plugins,my eclipse got real faster..
You can try the Eclipse plug-in 'Optimizer for Eclipse'. It really helped me to boost my Eclipse start-up.
It can update your settings by itself (change heap size, suggest the latest eclipse/jdk version, and more).
Link : https://zeroturnaround.com/free/optimizer-for-eclipse/
Disable unwanted plugins during startup.

Debugging in Eclipse on MacOS X slow - anything that I can do?

on my Mac debugging in Eclipse is extremly slow. With slow I mean stepping through the code. Every step (even if it is only multiline string-concatenation) takes about 1-2 seconds. When I compare that to eclipse running on Windows, that is just painful!
I'm using Eclipse Kepler with Sun JDK 1.7.0_45 (as Eclipse Runtime and Program Runtime). Switching to Apple JDK 6 did not change that much. Is there anything that I can do about that?
Edit:
What I'm trying to do is to debug a local application using Debug As > Java Application.
My eclipse.ini is looking like this:
-startup
../../../plugins/org.eclipse.equinox.launcher_1.3.0.v20130327-1440.jar
-vm
/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/bin/java
--launcher.library
../../../plugins/org.eclipse.equinox.launcher.cocoa.macosx.x86_64_1.1.200.v20130807-1835
-product
org.eclipse.epp.package.java.product
--launcher.defaultAction
openFile
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
--launcher.appendVmargs
-vmargs
-Dorg.eclipse.swt.internal.carbon.smallFonts
-Dorg.eclipse.swt.browser.IEVersion=10001
-Dosgi.requiredJavaVersion=1.6
-XstartOnFirstThread
-Dorg.eclipse.swt.internal.carbon.smallFonts
-XX:MaxPermSize=512m
-Xms40m
-Xmx2048m
-Xdock:icon=../Resources/Eclipse.icns
-XstartOnFirstThread
-Dorg.eclipse.swt.internal.carbon.smallFonts
Increase the amount of memory for your JVM. Open eclipse.ini from the following path:
Eclipse.app/Contents/MacOS/eclipse.ini
. Edit the following variables like so. Replace 1.6 with your version of Java.
-Dosgi.requiredJavaVersion = 1.6
-Xms128m
-Xmx1024m
The actual problem was a little bit unexpected: In the eclipse.ini there were two settings:
--launcher.XXMaxPermSize
256m
and
-XX:MaxPermSize=512m
For some reason eclipse preferred the 256m MaxPermSize setting. After changing that line to 512m everything works nice and fast. sigh software development tooling can be boring. Thanks for any responses to this question!
Remove all breakpoint definitions once and then restart it by adding the ones you need only.
Sometimes Eclipse is getting out of synch with some of its internal/displayed state.

Eclipse Failed to create the Java Virtual Machine

I'm using eclipse to develop android application and it always gone well, but today it's giving problems.
When i try to open eclipse it show me this message "Failed to create the java virtual machine. Error occurred during initialization of VM. Could not reserve enough space for object heap"
This is my eclipse.ini
-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.200.v20120913-144807
-product
com.android.ide.eclipse.adt.package.product
--launcher.XXMaxPermSize
256M
-showsplash
com.android.ide.eclipse.adt.package.product
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vmargs
-Dosgi.requiredJavaVersion=1.8
-Xms1336m
-Xmx1336m
-Declipse.buildId=v22.3.0-887826
-XX:MaxPermSize=512M
I tried to change "256m" in "512m" but it still doesn't work. I tried to restart but nothing. I tried to change the -XX:MaxPermSize=512M value, but nothing.
Just add your JDK path in windows environment variable.
Open eclipse.ini and change the following variables.
For -Dosgi.requiredJavaVersion=1.8, try changing your required Java version to 1.6.
Memory-related defaults (as of Eclipse 3.4):
-Xms40m
-Xmx256m
-XX:MaxPermSize=256m
Recommended settings for Android development:
-Xms128m
-Xmx512m
-XX:MaxPermSize=256m
If everything else fails you can just delete or rename eclipse.ini and let the IDE handle everything. I strongly suggest looking for a current replacement for your eclipse.ini and reading up on how to configure the eclipse.ini for Android development.
Closed all the other memory intensive application in my windows7. And tried to
open eclipse. This worked for me, and I found it on similar question here Stackoverflow-eclipse failed to create JVM.

Failed on starting Spring Tool Suite when I change XMx

I am trying to change and increase the default -Xmx768m to -Xmx1024 in STS.ini. However, on startup I get an error saying "Failed to create the JVM".
If I revert it back to 768 it works fine. Any idea as to what am I doing wrong and how can I improve the performance of STS?
Here is the configuration
-startup
plugins/org.eclipse.equinox.launcher_1.1.1.R36x_v20101122_1400.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.2.R36x_v20101222
-product
com.springsource.sts.ide
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
256M
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms256m
-Xmx768m
-XX:MaxPermSize=256m
You could try to attach the jvisualvm profiler tool (can be found in the bin folder of your jdk). If anything the tool will give you info about the jvm and its resource usage.
Be careful to use the tool that comes with the jdk you use for STS (most likely the one in JAVA_HOME but not necessarily).
Mind you that on a 32bit OS the JVM will never be able to get more than 1.6 GB of memory. If you have other software already in that same JVM as STS, jvisualvm will list them in the left side panel.

Eclipse - Java Heap error while in interface

I am pretty new to eclipse and it was working fine but now its giving me Java Heap problems and sometimes outofmemory issues...
Can anyone help me with my eclipse.ini ... i have increased some memory values and it got better but not perfect...
I am using this java but currently not doing java editing as such i am just in the eclipse interface ..
1.6 1.6.0_16 http://java.sun.com/products/autodl/j2se C:\Program Files\Java\jre6\bin\javaw.exe true
Here is my ini, its very small currently
-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
-product
org.eclipse.epp.package.rcp.product
--launcher.XXMaxPermSize
384M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
-nl en_US
-Dosgi.requiredJavaVersion=1.5
-Xms128m
-Xmx512m
-Djava.net.preferIPv4Stack=true
Heap issues have been seen before (see this question, or that one, for instance).
Various settings have been proposed (like here), since heap size can be specified in Java.
After quite a bit of experimenting with eclipse.ini, I found my version of it stable enough for most current usage.
See Eclipse Galileo 3.5 and 3.5.1 settings (as part of various other eclipse optimizations)

Categories