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

查看:593
本文介绍了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位JVM,原因不是技术而非行政/官僚 - 在生产环境中安装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 FAQ:

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天全站免登陆