1

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 ?

1

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

2 Comments

Thank you very much. You brought me on the right way. I mark the answer as usefull soon. But quick question. At the moment I have a stable development environment with a 32bit JVM and eclipse for android apps programming. What do you think, is it possible to install a jvm64 bit in parallel to execute my nonandroid java programm in parallel and using the same eclipse ? ( by configuration the special java app to point to the 64bit jvm ) ?
@user1344545 You can install as many versions as you like, until you run out of disk space. You only really need the latest update of each version you might like to run. AFAIK you can use a 64-bit version to do your android development.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.