简体   繁体   English

Java:无法为对象堆保留足够的空间

[英]Java : Could not reserve enough space for object heap

I am getting the following error when trying to run java with 1G memory. 尝试使用1G内存运行Java时出现以下错误。

C:\>java -verbose -Xmx1G

When I run it, I receive the following message: 当我运行它时,我收到以下消息:

Error occurred during initialization of VM
Could not reserve enough space for object heap
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

It is working fine with max memory set to 768M. 最大内存设置为768M时,它可以正常工作。 I am using Java 7 (build 1.7.0_15-b03). 我正在使用Java 7(build 1.7.0_15-b03)。

Here is my system's info 这是我系统的信息

Total Physical Memory:     3,510 MB
Available Physical Memory: 2,393 MB
Virtual Memory: Max Size:  2,048 MB
Virtual Memory: Available: 1,965 MB
Virtual Memory: In Use:    83 MB
OS: Windows XP.

The heap does not only depend on the available RAM or physical memory. 堆不仅取决于可用的RAM或物理内存。 The maximum theoretical heap limit for the 32-bit JVM is 4G. 32位JVM的最大理论堆限制为4G。 Due to various additional constraints such as available swap, kernel address space usage, memory fragmentation, and VM overhead, in practice the limit can be much lower. 由于各种其他限制,例如可用交换,内核地址空间使用,内存碎片和VM开销,在实践中,限制可能要低得多。

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

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