增加 Eclipse 的 JVM 最大堆大小 [英] Increase JVM max heap size for Eclipse
问题描述
我正在尝试增加 Eclipse 的最大堆大小.我曾尝试在 eclipse.ini
中或通过命令行指定,但没有工作.
I am trying to increase the max heap size for my Eclipse. I have tried specifying in eclipse.ini
or through the command line, but are not working.
我的最大堆大小在(运行 jconsole)之前和之后(System.out.println(java.lang.Runtime.getRuntime().maxMemory());
)具有完全相同的限制蚀.1.8G
My max heap size has the exact same limit before (running jconsole) and after (System.out.println(java.lang.Runtime.getRuntime().maxMemory());
) starting Eclipse. 1.8G
- 有没有办法在启动之前修改 JVM 堆大小(例如配置文件?)
- 在为 Eclipse 指定堆大小时,我可能做错了什么?
这是命令:
./eclipse/eclipse -debug -consoleLog -vmargs -Xms1000m -Xmx6000m -XX:-UseGCOverheadLimitcl
这是我的eclipse.ini
(这些值被指定的eclipse启动参数覆盖):
This is my eclipse.ini
(which values are overwritten by the specified eclipse launching parameters):
-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.200.v20120522-1813
-product
org.eclipse.epp.package.java.product
--launcher.defaultAction
openFile
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vmargs
-Dosgi.requiredJavaVersion=1.6
-Dhelp.lucene.tokenizer=standard
-XX:MaxPermSize=6000m
-Xms1000m
-Xmx6000m
推荐答案
可以使用命令行选项增加 Java 虚拟机 (JVM) 分配的堆大小.
It is possible to increase heap size allocated by the Java Virtual Machine (JVM) by using command line options.
-Xms<size> set initial Java heap size
-Xmx<size> set maximum Java heap size
-Xss<size> set java thread stack size
如果您使用的是 tomcat 服务器,您可以通过转到 Eclipse/Run/Run Configuration 并选择 Apache Tomcat/your_server_name/Arguments 并在 VM arguments 部分下使用以下内容来更改堆大小:
If you are using the tomcat server, you can change the heap size by going to Eclipse/Run/Run Configuration and select Apache Tomcat/your_server_name/Arguments and under VM arguments section use the following:
-XX:MaxPermSize=256m
-Xms256m -Xmx512M
如果您不使用任何服务器,则可以在运行代码之前在命令行中键入以下内容:
If you are not using any server, you can type the following on the command line before you run your code:
java -Xms64m -Xmx256m HelloWorld
可以在此处找到有关增加堆大小的更多信息
More information on increasing the heap size can be found here
这篇关于增加 Eclipse 的 JVM 最大堆大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!