如何将 intellij 32bit xmlx 增加超过 1GB?

2022-01-16 00:00:00 jvm intellij-idea java 32-bit

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

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 :

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

我无法将 intellij Xmx 增加到 900MB 以上
请帮帮我!

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

推荐答案

你不能这样做,因为 JVM 需要将所有堆分配在一个连续的块中,这可能因为内存碎片而无法实现.查看我的常见问题文章了解更多详情.

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 article for more details.

另见这张照片:

如您所见,总进程内存不仅仅是堆大小,因此更容易达到 2GB 操作系统限制.

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

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

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.

相关文章