Java Eclipse 中 Xmx 和 Xms 的最大值?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4304312/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-14 15:39:16  来源:igfitidea点击:

Max value of Xmx and Xms in Eclipse?

javaeclipsejvmmemory-managementapplication-settings

提问by Lieven Cardoen

Now my settings for these in the ini file are:

现在我在 ini 文件中的这些设置是:

-Xms768M -Xmx1024M

-Xms768M -Xmx1024M

When setting them higher, eclipse doesn't start anymore... Is there a way to increase these values without eclipse crashing?

将它们设置得更高时,日食不再启动......有没有办法增加这些值而不使日食崩溃?

采纳答案by Guillaume

The maximum values do not depend on Eclipse, it depends on your OS (and obviously on the physical memory available).

最大值不取决于 Eclipse,它取决于您的操作系统(显然还取决于可用的物理内存)。

You may want to take a look at this question: Max amount of memory per java process in Windows?

您可能想看看这个问题:Windows 中每个 Java 进程的最大内存量?

回答by Kichu

I am guessing you are using a 32 bit eclipse with 32 bit JVM. It wont allow heapsize above what you have specified.

我猜你正在使用带有 32 位 JVM 的 32 位 eclipse。它不允许堆大小超过您指定的大小。

Using a 64-bit Eclipse with a 64-bit JVM helps you to start up eclipse with much larger memory. (I am starting with -Xms1024m -Xmx4000m)

将 64 位 Eclipse 与 64 位 JVM 一起使用可帮助您以更大的内存启动 Eclipse。(我从 -Xms1024m -Xmx4000m 开始)

回答by tolki zianon

Why do you need -Xms768 (small heap must be at least 768...)?

为什么需要-Xms768(小堆必须至少768...)?

That means any java process (search in eclipse) will start with 768m memory allocated, doesn't that? That is why your eclipse isn't able to start properly.

这意味着任何 java 进程(在 eclipse 中搜索)都将从分配的 768m 内存开始,不是吗?这就是您的日食无法正常启动的原因。

Try -Xms16 -Xmx2048m, for instance.

例如,尝试 -Xms16 -Xmx2048m。

回答by Dennis Ahaus

I have tried the following config for eclipse.ini:

我已经为 eclipse.ini 尝试了以下配置:

org.eclipse.epp.package.jee.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
1024M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
1024m
--launcher.defaultAction
openFile
--launcher.appendVmargs
-vmargs
-Dosgi.requiredJavaVersion=1.6
-Xms128m
-Xmx2048m

Now eclipse performance is about 2 times faster then before.

现在 eclipse 的性能比以前快了大约 2 倍。

You can also find a good help ref here: http://help.eclipse.org/indigo/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/misc/runtime-options.html

您还可以在这里找到一个很好的帮助参考:http: //help.eclipse.org/indigo/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/misc/runtime-options.html