I am trying to run a java program through MATLAB. When my input file is a small size, it works fine. But when I increase the file size, and in turn increase my heap size I get this error message:
Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.
When I run my java com开发者_开发问答mand with -Xmx1500m
it works fine, but when I increase it to -Xmx2000m
it gives the error message. The computer I'm on has 12 GB of memory, so I don't see why increasing my heap size to 2000 should be a problem. I don't have any memory clogging programs running.
It appears you are using a 32-bit JVM. Java requires a single block of continuous memory for its heap and depending on the OS this is limited to 1.2 to 1.6 GB depending on your OS regardless of the amount of memory you have.
If you use a 64-bit JVM you don't have this problem.
精彩评论