Java 1.6 32位最小和最大堆内存问题 [英] java 1.6 32-bit min and max heap memory issue
问题描述
我安装了32位的JRE v1.6.当我尝试如下运行程序时:
I have the JRE v1.6 that is 32-bit installed. When I attempt to run a program as follows:
java -Xms1024m -Xmx2048m net.analysis.MyProg
我看到显示以下消息:
Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine
据我所知,一个32位JVM允许的最大堆为2 GB.在运行我的代码的计算机上,有131061 MB的物理内存(使用Window的任务管理器,有128 GB的RAM).
As far as I know, the maximum heap allowed for a 32-bit JVM is 2 GB. On the computer running my code there is 131061 MB of physical memory (using Window's Task Manager, 128 GB of RAM).
有人知道我在做什么错吗?
Does anyone know what am I doing wrong here?
推荐答案
在您的情况下,限制很可能是32位体系结构以及Windows分配虚拟地址空间的方式.
In your case, the limit is most likely the 32 bit architecture and the way that Windows is apportioning the virtual address space.
根据 Oracle JVM FAQ ,您只能希望在Windows的32位JVM上达到1.4Gb到1.6Gb.
According to the Oracle JVM FAQ, you can only expect to get 1.4Gb to 1.6Gb on a 32bit JVM on Windows.
这篇关于Java 1.6 32位最小和最大堆内存问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!