简体   繁体   中英

java jvm memory assignment

I have a program that is very memory consuming and thought to assign more maximum memory to the java jvm using -Xmx2048m. But when starting I get a 'Could not reserve enough space for object heap' error.

When trying several values and found out that my greatest value is -Xmx1560m and it starts. But I like to assign 2GB. I have 6GB physical Memory and Taskmanager shows 3400MB available after I started the java-process with -Xmx1560m.

Do anyone know why I can't assign 2GB ?

32-bit windows limits programs to around 1.2 - 1.5 GB of continuous memory. This limit applies even if you have a 64-bit OS but you are emulating a 32-bit environment for a 32-bit JVM.

The way to avoid this limit is to use a 64-bit OS and a 64-bit JVM and the limit is much higher depending on the flavour of Windows you have bought. Professional edition is limited to 192 GB.

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