Java Heap Space error on Layout xml: GC overhead limit exceeded

349 views Asked by At

I am struggling with Java Heap Space Error when i worked with any layout xml in android

I search on SO but error still remain. My Error Log

java.lang.OutOfMemoryError: GC overhead limit exceeded
    at java.util.Arrays.copyOf(Arrays.java:2367)
    at java.lang.String.<init>(String.java:168)
    at org.eclipse.wst.xml.core.internal.document.AttrImpl.getName(AttrImpl.java:158)
    at org.eclipse.wst.xml.core.internal.contentmodel.util.NamespaceAttributeVisitor.visitElement(NamespaceAttributeVisitor.java:73)
    at org.eclipse.wst.xml.core.internal.contentmodel.util.NamespaceTable.addElement(NamespaceTable.java:216)
    at org.eclipse.wst.xml.core.internal.contentmodel.modelqueryimpl.XMLAssociationProvider.getCMElementDeclaration(XMLAssociationProvider.java:334)
    at org.eclipse.wst.xml.core.internal.contentmodel.modelqueryimpl.XMLAssociationProvider.getCMElementDeclaration(XMLAssociationProvider.java:223)
    at org.eclipse.wst.xml.core.internal.contentmodel.modelqueryimpl.ModelQueryImpl.getCMElementDeclaration(ModelQueryImpl.java:116)
    at org.eclipse.wst.xml.core.internal.document.DocumentImpl.getCMAttributes(DocumentImpl.java:1077)
    at org.eclipse.wst.xml.core.internal.document.ElementImpl.getDefaultValue(ElementImpl.java:378)
    at org.eclipse.wst.xml.core.internal.document.ElementImpl.getAttributeNS(ElementImpl.java:336)
    at com.android.ide.eclipse.adt.internal.editors.layout.gle2.LayoutMetadata.getProperty(LayoutMetadata.java:152)
    at com.android.ide.eclipse.adt.internal.editors.layout.gle2.LayoutMetadata.getNodeBinding(LayoutMetadata.java:332)
    at com.android.ide.eclipse.adt.internal.editors.layout.ProjectCallback.getAdapterBinding(ProjectCallback.java:612)
    at com.android.layoutlib.bridge.impl.RenderSessionImpl.postInflateProcess(RenderSessionImpl.java:1237)
    at com.android.layoutlib.bridge.impl.RenderSessionImpl.postInflateProcess(RenderSessionImpl.java:1296)
    at com.android.layoutlib.bridge.impl.RenderSessionImpl.postInflateProcess(RenderSessionImpl.java:1296)
    at com.android.layoutlib.bridge.impl.RenderSessionImpl.postInflateProcess(RenderSessionImpl.java:1296)
    at com.android.layoutlib.bridge.impl.RenderSessionImpl.postInflateProcess(RenderSessionImpl.java:1296)
    at com.android.layoutlib.bridge.impl.RenderSessionImpl.postInflateProcess(RenderSessionImpl.java:1296)
    at com.android.layoutlib.bridge.impl.RenderSessionImpl.postInflateProcess(RenderSessionImpl.java:1296)
    at com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:411)
    at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:332)
    at com.android.ide.common.rendering.LayoutLibrary.createSession(LayoutLibrary.java:349)
    at com.android.ide.eclipse.adt.internal.editors.layout.gle2.RenderService.createRenderSession(RenderService.java:519)
    at com.android.ide.eclipse.adt.internal.editors.layout.gle2.GraphicalEditorPart.renderWithBridge(GraphicalEditorPart.java:1584)
    at com.android.ide.eclipse.adt.internal.editors.layout.gle2.GraphicalEditorPart.recomputeLayout(GraphicalEditorPart.java:1309)
    at com.android.ide.eclipse.adt.internal.editors.layout.gle2.GraphicalEditorPart$ReloadListener.reloadLayoutSwt(GraphicalEditorPart.java:1817)
    at com.android.ide.eclipse.adt.internal.editors.layout.gle2.GraphicalEditorPart$ReloadListener.access$0(GraphicalEditorPart.java:1755)
    at com.android.ide.eclipse.adt.internal.editors.layout.gle2.GraphicalEditorPart$ReloadListener$1.run(GraphicalEditorPart.java:1749)
    at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
    at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136)


    eclipse conf properties

org.eclipse.platform --launcher.XXMaxPermSize 1024m --launcher.defaultAction openFile --launcher.appendVmargs -vmargs -Dosgi.requiredJavaVersion=1.7 -XX:MaxPermSize=1024m -Xms512m -Xmx2048m

2

There are 2 answers

0
Shahzad On

This sort of error is usually caused because of large image sizes. Have you tried putting android:largeHeap="true" in your AndroidManifest.xml file? Try this, if you haven't already, and and you will most likely get rid of the problem.

0
Suman Dey On

Simply restart IDE and stop other application also. This is experience and i go through this several times.