64 位操作系统上 32 位 JVM 的最大 Java 堆大小 [英] Maximum Java heap size of a 32-bit JVM on a 64-bit OS

查看:42
本文介绍了64 位操作系统上 32 位 JVM 的最大 Java 堆大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题不在于 32 位操作系统上的最大堆大小,因为 32 位操作系统的最大可寻址内存大小为 4GB,而 JVM 的最大堆大小取决于可以有多少连续可用内存保留.

The question is not about the maximum heap size on a 32-bit OS, given that 32-bit OSes have a maximum addressable memory size of 4GB, and that the JVM's max heap size depends on how much contiguous free memory can be reserved.

我更想知道在 64 位操作系统中运行的 32 位 JVM 的最大(理论和实际可实现的)堆大小.基本上,我正在查看类似于 的答案SO 相关问题中的数字.

I'm more interested in knowing the maximum (both theoretical and practically achievable) heap size for a 32-bit JVM running in a 64-bit OS. Basically, I'm looking at answers similar to the figures in a related question on SO.

至于为什么使用 32 位 JVM 而不是 64 位,原因不是技术而是管理/官僚 - 在生产环境中安装 64 位 JVM 可能为时已晚.

As to why a 32-bit JVM is used instead of a 64-bit one, the reason is not technical but rather administrative/bureaucratic - it is probably too late to install a 64-bit JVM in the production environment.

推荐答案

32 位 JVM 期望拥有单个大内存块并使用原始指针不能使用超过 4 Gb(因为这是 32 位限制,也适用于指针).这包括 Sun 和 - 我很确定 - 还有 IBM 实现.我不知道是否例如JRockit 或其他公司的 32 位实现有一个大内存选项.

32-bit JVMs which expect to have a single large chunk of memory and use raw pointers cannot use more than 4 Gb (since that is the 32 bit limit which also applies to pointers). This includes Sun and - I'm pretty sure - also IBM implementations. I do not know if e.g. JRockit or others have a large memory option with their 32-bit implementations.

如果您希望达到此限制,您应该强烈考虑开始并行跟踪,为您的生产环境验证 64 位 JVM,以便在 32 位环境崩溃时做好准备.否则,您将不得不在压力下完成这项工作,这绝不是好事.

If you expect to be hitting this limit you should strongly consider starting a parallel track validating a 64-bit JVM for your production environment so you have that ready for when the 32-bit environment breaks down. Otherwise you will have to do that work under pressure, which is never nice.

编辑 2014-05-15:Oracle 常见问题解答:

Edit 2014-05-15: Oracle FAQ:

32 位 JVM 的最大理论堆限制为 4G.由于可用交换、内核地址空间使用、内存碎片和 VM 开销等各种附加约束,实际上限制可能要低得多.在大多数现代 32 位 Windows 系统上,最大堆大小范围为 1.4G 到 1.6G.在 32 位 Solaris 内核上,地址空间限制为 2G.在运行 32 位 VM 的 64 位操作系统上,最大堆大小可以更高,在许多 Solaris 系统上接近 4G.

(http://www.oracle.com/technetwork/java/hotspotfaq-138619.html#gc_heap_32bit)

这篇关于64 位操作系统上 32 位 JVM 的最大 Java 堆大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆