简体   繁体   中英

Java: Could not reserve enough space for object heap

I am trying to allocate 2 gigs of ram to a java application started from a bat file using this line of code:

 @echo off
    "%ProgramFiles(x86)%\Java\jre6\bin\java.exe" -Xmx2G -Xms1G -jar craftbukkit-1.2.5-R4.0.jar
    pause

When I attempt to run it like this, however, it spits out an error saying:

 Error occurred during initialization of VM
    Could not reserve enough space for object heap
    Could not create teh Java virtual machine
    Press any key to continue . . .

I currently have 8 gig of ram in my computer and I know I am using a max of 3 gigs at all times(I let the computer sit for the most part just running this server file). I have 2x4gig sticks of ram so I know its not separated out, and I know that I have enough free ram to allocate so why would it not let me? I am able to allocate 1536M(1.5 gigs) and under, but if I jump to 2G's it gives me this error. Any help is appreciated

您应该确保使用64位版本的java - 32位版本即使在64位窗口上也无法分配那么多

you just have to provide more space to the tomcat. for that you have to go to tomcat directory in it "bin" than go to setenv.bat file and then increase the size of "MaxPermSize=256m" 512m will be enough

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