简体   繁体   中英

Java heap size problem in MATLAB

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 command 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.

refer to this thread Java maximum memory on Windows XP

Also my favorite article on this topic Thanks for the memory

edit: replaced first link, sorry

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