为什么我在Eclipse中遇到OutOfMemory异常? [英] Why I am getting OutOfMemory exception in Eclipse?

查看:81
本文介绍了为什么我在Eclipse中遇到OutOfMemory异常?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在eclipse中打开工作空间,一旦打开工作空间会引发以下异常:-

I am trying to open a workspace in eclipse , as soon as it open the workspace throws below exception:-

!ENTRY org.eclipse.core.resources 2 10035 2012-01-03 20:55:15.212

!MESSAGE在上一个会话中,工作空间因未保存的更改而退出;刷新工作空间以恢复更改.

!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes.

!ENTRY org.eclipse.core.jobs 4 2 2012-01-03 20:55:29.345!MESSAGE在以下过程中发生内部错误:从选择中请求Java AST".!堆栈0java.lang.OutOfMemoryError:请求的数组大小超出了VM限制在org.eclipse.jdt.internal.core.index.DiskIndex.readHeaderInfo(DiskIndex.java:787)在org.eclipse.jdt.internal.core.index.DiskIndex.initialize(DiskIndex.java:389)在org.eclipse.jdt.internal.core.index.Index.(Index.java:97)在org.eclipse.jdt.internal.core.search.indexing.IndexManager.getIndex(IndexManager.java:253)在org.eclipse.jdt.internal.core.search.indexing.IndexManager.getInde

!ENTRY org.eclipse.core.jobs 4 2 2012-01-03 20:55:29.345 !MESSAGE An internal error occurred during: "Requesting Java AST from selection". !STACK 0 java.lang.OutOfMemoryError: Requested array size exceeds VM limit at org.eclipse.jdt.internal.core.index.DiskIndex.readHeaderInfo(DiskIndex.java:787) at org.eclipse.jdt.internal.core.index.DiskIndex.initialize(DiskIndex.java:389) at org.eclipse.jdt.internal.core.index.Index.(Index.java:97) at org.eclipse.jdt.internal.core.search.indexing.IndexManager.getIndex(IndexManager.java:253) at org.eclipse.jdt.internal.core.search.indexing.IndexManager.getInde

我尝试增加内存,尝试使用最新的Eclipse靛蓝,但是会引发相同的错误.有人可以帮我解决该错误吗?

I tried to increase the memory , tried to use latest eclipse indigo but it throws the same error. Can somebody help me how should I resolve this error?

谢谢,马诺伊

推荐答案

您究竟如何增加内存?

尝试使用引用-Xms 和 -Xmx 玩吗?"rel ="nofollow">堆大小可用于Eclipse.有时还会增加 -XX:PermSize -XX:MaxPermSize ( permgen )值也有帮助.

Try to play with -Xms and -Xmx that refer to the heap size available for Eclipse. Also sometimes increasing -XX:PermSize and -XX:MaxPermSize (permgen) values helps too.

例如,以下是我的 eclipse.ini 中的值(总RAM为8GB):

For example, here are the values from my eclipse.ini (having 8GB total RAM):

...

-vmargs
-XX:MaxPermSize=2048m
-Xms320m
-Xmx3072m

...

这篇关于为什么我在Eclipse中遇到OutOfMemory异常?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆