简体   繁体   English

Java 1.6 32位最小和最大堆内存问题

[英]java 1.6 32-bit min and max heap memory issue

I have the JRE v1.6 that is 32-bit installed. 我安装了32位的JRE v1.6。 When I attempt to run a program as follows: 当我尝试如下运行程序时:

java -Xms1024m -Xmx2048m net.analysis.MyProg

I see the following message displayed: 我看到显示以下消息:

Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine

As far as I know, the maximum heap allowed for a 32-bit JVM is 2 GB. 据我所知,一个32位JVM允许的最大堆为2 GB。 On the computer running my code there is 131061 MB of physical memory (using Window's Task Manager, 128 GB of RAM). 在运行我的代码的计算机上,有131061 MB的物理内存(使用Window的任务管理器,有128 GB的RAM)。

Does anyone know what am I doing wrong here? 有人知道我在这里做错什么吗?

In your case, the limit is most likely the 32 bit architecture and the way that Windows is apportioning the virtual address space. 在您的情况下,限制很可能是32位体系结构以及Windows分配虚拟地址空间的方式。

According to the Oracle JVM FAQ , you can only expect to get 1.4Gb to 1.6Gb on a 32bit JVM on Windows. 根据Oracle JVM FAQ ,您只能期望在Windows上的32位JVM上获得1.4Gb到1.6Gb。

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

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