简体   繁体   中英

Java : Could not reserve enough space for object heap

I am getting the following error when trying to run java with 1G memory.

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. I am using 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. The maximum theoretical heap limit for the 32-bit JVM is 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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