获取“Java 堆空间"时的 Eclipse 内存设置和“内存不足" [英] Eclipse memory settings when getting "Java Heap Space" and "Out of Memory"
问题描述
尝试在 Eclipse 中启动和运行 flex/java 项目时,我一直使用 Eclipse、Tomcat 和 JRE 收到内存不足异常"和Java 堆空间".
When trying to launch and run a flex/java project in eclipse I kept getting a "Out of Memory Exception" and "Java Heap Space" using Eclipse, Tomcat and a JRE.
在研究尝试调整内存设置时,我发现了三个可以调整这些设置的地方:
While researching trying to adjust the memory settings I found three places to adjust these:
Eclipse.ini
Eclipse.ini
Window > Preferences 下的 JRE 设置
The JRE Settings under Window > Preferences
Catalina.sh 或 Catalina.bat
Catalina.sh or Catalina.bat
在这些不同的地方设置 -xms 和 -xmx 有什么区别,是什么意思?
What are the differences between setting -xms and -xmx in these different places and what does is mean?
有什么方法可以验证这些内存设置是否相应地设置?
Is there any way to verify these memory settings are being set accordingly?
对于具有 2GB RAM 的计算机,最佳的 -xms 和 -xmx 设置是什么?
What are the optimal -xms and -xmx settings for a computer with 2gb of RAM?
还有其他记忆技巧吗?
谢谢.
推荐答案
-xms 是启动内存(在 VM 启动时),-xmx 是 VM 的最大内存
-xms is the start memory (at the VM start), -xmx is the maximum memory for the VM
- eclipse.ini : 运行 eclipse 的 VM 的内存
- jre 设置:用于从 Eclipse 运行的 Java 程序的内存
- catalina.sh : tomcat 服务器的内存
这篇关于获取“Java 堆空间"时的 Eclipse 内存设置和“内存不足"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!