简体   繁体   English

--Xmx 的 Java JVM 限制

[英]Java JVM limits for --Xmx

I am running a java app on a Windows 10 machine via我正在 Windows 10 机器上运行一个 java 应用程序

JAVA -Xms1500M -Xmx1600M -jar appname.jar

The app fails after a while with an error stating not enough heap space.应用程序在一段时间后失败,并显示错误,指出堆空间不足。 When it is running using Task Manager I can see I am using about 50% of the total memory available on the machine.当它使用任务管理器运行时,我可以看到我使用了机器上可用总内存的大约 50%。

If I try and increase the -Xmx space then I get an error saying it cannot be allocated - why is this as there is plenty of memory free?如果我尝试增加 -Xmx 空间,那么我会收到一条错误消息,指出它无法分配 - 为什么会这样,因为有足够的可用内存?

The Java app is a 3rd party and I know it runs on colleagues pcs Java 应用程序是第 3 方,我知道它在同事的电脑上运行

在此处输入图片说明

My JVM version is我的JVM版本是

在此处输入图片说明

I suspect that you are running a 32 bit JVM.我怀疑您正在运行 32 位 JVM。 (According to the version info you have an Oracle release, and Java 8 was the last versin that Oracle provided 32 bit downloadables for.) (根据版本信息,您有一个 Oracle 版本,Java 8 是 Oracle 提供 32 位下载的最后一个版本。)

Assuming that is the case, the max heap size for a 32 bit Java on Windows is limited to between 1.4 and 1.6GB.假设是这种情况,Windows 上 32 位 Java 的最大堆大小限制在 1.4 到 1.6GB 之间。 The limit is a result of the way that Windows allocates virtual address spaces.该限制是 Windows 分配虚拟地址空间的方式的结果。 For more details read:欲了解更多详情,请阅读:

The solution is to download and install a 64 bit Java release for Windows.解决方案是下载并安装适用于 Windows 的 64 位 Java 版本。 You want a download for the "x86-64" architecture.您需要“x86-64”架构的下载。

(I notice that you are running 1.8.0_101. That was released in July 2016 and is way out of date. At time of writing, the most recent Java 8 release is 1.8.0_231.) (我注意到您正在运行 1.8.0_101。它于 2016 年 7 月发布,已经过时了。在撰写本文时,最新的 Java 8 版本是 1.8.0_231。)


The Java app is a 3rd party and I know it runs on colleagues pcs Java 应用程序是第 3 方,我知道它在同事的电脑上运行

They probably have installed 64 bit Java.他们可能已经安装了 64 位 Java。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM