java 如何将intellij 32bit xmx增加到1GB以上?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/13489469/
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-10-31 12:57:48  来源:igfitidea点击:

How to increase intellij 32bit xmx more than 1GB?

intellij-ideajvmjava32-bit

提问by Mohsen Kashi

I am using 32bit Intellij on my 32bit windows XP with 4 GB of RAM.
I am attempting to increase intellij xmx to 1.5GB : -Xmx1500m
So I know JVM support 1.5GB of RAM in 32bit systems.
But this error throws from JVM :

我在具有 4 GB RAM 的 32 位 Windows XP 上使用 32 位 Intellij。
我正在尝试将 intellij xmx 增加到 1.5GB :-Xmx1500m
所以我知道 JVM 在 32 位系统中支持 1.5GB 的 RAM。
但是这个错误是从 JVM 抛出的:

The JVM could not be started. The maximum heap size (-Xmx) might be too large ...

I can't increase intellij Xmx more than 900MB
Please help me!

我不能增加intellij Xmx 超过900MB
请帮帮我!

回答by CrazyCoder

You can't do it as JVM needs to allocate all the heap in a single continuous chunk, which may not be possible because of the memory fragmentation. See my FAQ articlefor more details.

您不能这样做,因为 JVM 需要在单个连续块中分配所有堆,这可能由于内存碎片而无法实现。有关更多详细信息,请参阅我的常见问题解答文章

See also this picture:

另见这张图片:

JVM heap

JVM 堆

As you can notice, total process memory is not just the heap size, making it much easier to hit the 2GB OS limit.

正如您所注意到的,总进程内存不仅仅是堆大小,更容易达到 2GB 的操作系统限制。

The actual heap that can be used varies on the OS configuration and on other applications that are running (DLLs with hooks inject into process space and cause additional fragmentation). Usually it's somewhere between 512M and 1G, but can be higher on a clean system.

可以使用的实际堆因操作系统配置和正在运行的其他应用程序而异(带有钩子的 DLL 注入进程空间并导致额外的碎片)。通常它介于 512M 和 1G 之间,但在干净的系统上可能更高。