3

我的错误日志中出现了这个错误,我的 Eclipse 完全挂起,说我的 xml 布局文件有 80 多个视图,现在为了携带一些页眉页脚和一些边框布局,我需要有这么多视图,

这个问题有什么解决办法??????

eclipse.buildId=I20100608-0911
java.version=1.6.0_35
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Framework arguments:  -product org.eclipse.epp.package.jee.product
Command-line arguments:  -os win32 -ws win32 -arch x86 -product org.eclipse.epp.package.jee.product


Error
Wed Oct 24 17:15:01 IST 2012
activity_change_alert_settings.xml: Java heap space

java.lang.OutOfMemoryError: Java heap space
at org.eclipse.jdt.internal.compiler.util.Util.getInputStreamAsByteArray(Util.java:317)
at org.eclipse.jdt.internal.core.util.Util.getResourceContentsAsByteArray(Util.java:1136)
at org.eclipse.jdt.internal.core.JavaProject.readFileEntriesWithException(JavaProject.java:2420)
at org.eclipse.jdt.internal.core.JavaProject.readFileEntries(JavaProject.java:2461)
at org.eclipse.jdt.internal.core.JavaProject.readRawClasspath(JavaProject.java:2499)
at com.android.ide.eclipse.adt.internal.resources.manager.ProjectClassLoader.getExternalJars(ProjectClassLoader.java:260)
at com.android.ide.eclipse.adt.internal.resources.manager.ProjectClassLoader.loadClassFromJar(ProjectClassLoader.java:232)
at com.android.ide.eclipse.adt.internal.resources.manager.ProjectClassLoader.findClass(ProjectClassLoader.java:76)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at com.android.ide.eclipse.adt.internal.editors.layout.ProjectCallback.loadView(ProjectCallback.java:153)
at android.view.BridgeInflater.loadCustomView(BridgeInflater.java:207)
at android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:135)
at android.view.LayoutInflater.inflate(LayoutInflater.java:466)
at com.android.layoutlib.bridge.android.BridgeContext.inflateView(BridgeContext.java:364)
at com.android.layoutlib.bridge.impl.binding.BaseAdapter.getView(BaseAdapter.java:148)
at com.android.layoutlib.bridge.impl.binding.FakeAdapter.getView(FakeAdapter.java:106)
at android.widget.Spinner.measureContentWidth(Spinner.java:669)
at android.widget.Spinner.onMeasure(Spinner.java:432)
at android.view.View.measure(View.java:15172)
at android.widget.TableRow.getColumnsWidths(TableRow.java:312)
at android.widget.TableLayout.findLargestCells(TableLayout.java:504)
at android.widget.TableLayout.measureVertical(TableLayout.java:469)
at android.widget.TableLayout.onMeasure(TableLayout.java:435)
at android.view.View.measure(View.java:15172)
at android.widget.RelativeLayout.measureChild(RelativeLayout.java:602)
at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:415)
at android.view.View.measure(View.java:15172)
at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:617)
at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:399)
at android.view.View.measure(View.java:15172)
at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:617)
4

1 回答 1

10

尝试增加 eclipse.ini 文件中的 java 堆空间设置,看看是否有帮助

--launcher.XXMaxPermSize
512M
-Xms512m
-Xmx1024m

这三个设置是您需要修改的设置。如果 Eclipse 继续挂起,您可以选择更高的值。

于 2012-10-24T11:52:44.783 回答