1

I am using Eclipse 4.4.1 and i always encounter this error, i can not work with eclipse.

Is there any way to fix it?

My eclipse.ini:

-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20140415-2008.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.200.v20140603-1326
-product
org.eclipse.epp.package.jee.product
--launcher.defaultAction
openFile
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
2048m
--launcher.defaultAction
openFile
--launcher.appendVmargs
-vmargs
-Dosgi.requiredJavaVersion=1.6
-XX:+UseParallelGC
-XX:PermSize=512M
-XX:MaxPermSize=2048m
-Xms512m
-Xmx2048m

Exception stack trace:

java.lang.OutOfMemoryError: Java heap space
    at org.eclipse.ui.part.ResourceTransfer.nativeToJava(ResourceTransfer.java:162)
    at org.eclipse.swt.dnd.Clipboard.getContents(Clipboard.java:330)
    at org.eclipse.swt.dnd.Clipboard.getContents(Clipboard.java:241)
    at org.eclipse.ui.internal.navigator.resources.actions.PasteAction$1.run(PasteAction.java:192)
    at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:187)
    at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:156)
    at org.eclipse.swt.widgets.Display.syncExec(Display.java:4590)
    at org.eclipse.ui.internal.navigator.resources.actions.PasteAction.updateSelection(PasteAction.java:186)
    at org.eclipse.ui.actions.BaseSelectionListenerAction.selectionChanged(BaseSelectionListenerAction.java:124)
    at org.eclipse.ui.internal.navigator.resources.actions.EditActionGroup.updateActionBars(EditActionGroup.java:153)
    at org.eclipse.ui.internal.navigator.resources.actions.EditActionGroup.fillActionBars(EditActionGroup.java:99)
    at org.eclipse.ui.internal.navigator.resources.actions.EditActionProvider.fillActionBars(EditActionProvider.java:49)
    at org.eclipse.ui.navigator.NavigatorActionService$3.run(NavigatorActionService.java:259)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.ui.navigator.NavigatorActionService.fillActionBars(NavigatorActionService.java:253)
    at org.eclipse.ui.navigator.CommonNavigatorManager.selectionChanged(CommonNavigatorManager.java:222)
    at org.eclipse.jface.viewers.Viewer$2.run(Viewer.java:163)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:50)
    at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:178)
    at org.eclipse.jface.viewers.Viewer.fireSelectionChanged(Viewer.java:160)
    at org.eclipse.jface.viewers.StructuredViewer.updateSelection(StructuredViewer.java:2171)
    at org.eclipse.jface.viewers.StructuredViewer.handleSelect(StructuredViewer.java:1202)
    at org.eclipse.ui.navigator.CommonViewer.handleSelect(CommonViewer.java:478)
    at org.eclipse.jface.viewers.StructuredViewer$4.widgetSelected(StructuredViewer.java:1231)
    at org.eclipse.jface.util.OpenStrategy.fireSelectionEvent(OpenStrategy.java:242)
    at org.eclipse.jface.util.OpenStrategy.access$4(OpenStrategy.java:236)
    at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:408)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4454)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1388)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3799)

Session data:

eclipse.buildId=4.4.1.M20140925-0400
java.version=1.7.0_71
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Framework arguments:  -product org.eclipse.epp.package.jee.product
Command-line arguments:  -os linux -ws gtk -arch x86_64 -product org.eclipse.epp.package.jee.product
6
  • This is definitely finding something very large in the clipboard and running out of memory trying to look at it. Commented Oct 24, 2014 at 6:50
  • @greg-449 After computer restart, i think everything is clear, i will disable all applications and response as fast as i can. Commented Oct 24, 2014 at 6:52
  • I am looking at the source code of where your exception occurs, this code is definitely finding something in the clipboard (or there is a bug in the clipboard code) Commented Oct 24, 2014 at 6:56
  • @greg-449 Now, every time the Eclipse raise error, i copy some text(in any application), the eclipse will not raise error. So i think the problem come from my os(Fedora 20 Gnome with conflict app). Commented Oct 25, 2014 at 1:52
  • launcher.XXMaxPermSize=2048m: this is WAAAY too big, it may be your problem. Set it around 3/400 megs maximum, you'll never need more than that (while keeping the heap as big as it is or bigger). Commented Oct 30, 2014 at 13:56

2 Answers 2

4

I noticed this behavior after i installed https://extensions.gnome.org/extension/779/clipboard-indicator/. Do you also have this extension installed? When I disable this extension (and restart gnome-shell) the exception in Eclipse is gone. Can you confirm this?

I have made a bug report here: https://bugs.eclipse.org/bugs/show_bug.cgi?id=449902.

Sign up to request clarification or add additional context in comments.

4 Comments

Exactly, as i commented: the issue may come from OS flatform :-)
I confirm I noticed the same problem in Eclipse CDT Luna Service Release 2 (4.4.2). I disabled clipboard-indicator gnome extension and the problem was resolved.
I updated the gnome shell extension yesterday and it seems the issue is now resolved.
I can confirm this today. I was using Eclipse v1.8 (because of OMNeT++ limitations of the libraries that I'm using) with GNOME and with the Clipboard extension enabled. I disabled it, restarted and now it runs as it always should be.
1

You don't say how much memory you have on your computer, but you are very likely specifying overly large memory requirements.

Check this excellent answer:

Per your settings, I believe you would need 1GB of free memory to start, and could use much more than that if loading a large project.

If that does not help, then I also noticed that the exception is occurring in a method that would appear to be related to clipboard transfer. Is it possible you have a very large data set in your clipboard? That's just a guess and I don't know why Eclipse would want to transfer data from the clipboard on load.

5 Comments

I have 8GB, I have encountered this issue when eclipse start with default memory settings, then i try to increase the ram from 256 to 512 to 1024 and to 2048MB, but the problem still occur.
Then as I said, do you possibly have something large on your clipboard? (Try copying something small, like a piece of text.) Have you tried starting Eclipse immediately after restarting your computer?
Yes, but the very strange thing is i just encounter this issue after restarting my computer, if i wait for 15 minutes, the eclipse will work normally.
That is strange. You mentioned that you have tried starting with lower memory requirements. I have you applied the lower memory settings to both the Heap and PermGen ? i.e. -Xms512m -Xmx512m -XX:PermSize=128m -XX:MaxPermSize=128m ? If that does not help, then I am not sure what else to suggest.
Thanks @kaliatech for your effort, your suggestion i have tried before, i will try to reinstall java and eclipse.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.