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

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.

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.

Eclipse Luna + ADT -freeze 99% when running app on mac

I was using Eclipse Luna + ADT, everything was fine, but today, when I try to run my project in my cel, it freezes to 99%, and then says:
Unable to execute dex: GC overhead limit exceeded
and then :
Unhandled loop expected
The only solution I find is go back to ADT Bundle ( w/ Kepler), but I don't love this solution as Eclipse is very outdate...
Any help will be appreciated
This Link Helped me a lot.
As what is said in the link above, you should increase the size of memory used by eclipse.
Just open the eclipse.ini file, located in the same folder as eclipse.exe is located by a text editor.
The original eclipse.ini file looks like this:
-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20130327-1440.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.200.v20140116-2212
-product
org.eclipse.epp.package.jee.product
--launcher.defaultAction
openFile
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
--launcher.appendVmargs
-vmargs
-Dosgi.requiredJavaVersion=1.6
-XX:MaxPermSize=256m
-Xms40m
-Xmx512m
Now change the last 2 lines to:
-Xms512m
-Xmx1024m
You can also increase the value of MaxPermSize, as the following:
-XX:MaxPermSize=1024m
This solution helped me and solve my problem.
Good luck

What is the simplest way to fix the Out Of Memory Perm Size of GWT running in eclipse Juno?

When running my Gwt app in eclipse environment & especially when refreshing the page I often have either "Out Of Memory Perm Size" problem or the page took very long time to load & finally die out.
Some instructions from other questions are not very clear & each person produces a different solution to set memory, which made me really confused.
Here is my eclipse.ini file in C:\eclipse-jee-juno-SR1-win32-x86_64\eclipse:
-clean
-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.200.v20120522-1813
-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
-Dhelp.lucene.tokenizer=standard
-Xms40m
-Xmx512m
Also, in my eclipse, Run--> Debug Configurations --> Arguments tab --> I saw
VM arguments: -Xmx2048m // this is quite high number why it still very slow??
I need the simplest way to fix it. so What is the simplest way to fix this problem?
Start up Visual VM and see what each generation of memory is doing.
I would focus on the perm gen. You can increase its setting like this:
-Xms256m -Xmx512m -XX:MaxPermSize=256m
You'd better be running on a 64-bit operating system. The 32 bit JVM won't allow max heap larger than 1.2-1.5MB.

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.

Eclipse Indigo typing lag on OS X Lion

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

Categories