silverkid
silverkid

Reputation: 9563

increasing heap size in java program gives problem

i am using a java program which requires a lot of ram. ( Ideally i would want to give it

10 GB of ram )

this program is run using a bat file. which has the following command to set java heap size

java  -Xmx896m weka.gui.explorer.Explorer

which allocates it 896 MB.

I am running this program on a high end 64bit server with windows 2003 64bit standard OS.

when i try to change the bat file to increase heap size to lets say 1.8 GB by using

java  -Xmx1896m weka.gui.explorer.Explorer

it gives an error message - "Could not reserve enough space for object heap " and the program doesnt start

how can i give this program a greater heap size atleast upto 4 GB

Upvotes: 2

Views: 1861

Answers (1)

Jack
Jack

Reputation: 133557

Did you try using -d64 to specify JVM to use 64 bit version?

java -d64 -Xmx2g weka.gui.explorer.Explorer

Just for information, that error should raise when JVM is trying to call mmap function to obtain the address space for the heap from operating system with an invalid size.

Upvotes: 2

Related Questions