Java heap size issue in MATLAB

I am trying to run a java program through MATLAB. When my input file is small, it works fine. But when I increase the file size and, in turn, increase the heap size, I get this error message:

Error initializing VM

Failed to reserve enough space for the heap of objects

Failed to create Java virtual machine.

When I run my java command using -Xmx1500m , it works fine, but when I increase it to -Xmx2000m , it gives an error message. The computer I work on has 12 GB of memory, so I don’t understand why the problem of increasing the heap size to 2000 should be a problem. I do not have programs for clogging memory.

+6
source share
2 answers

It looks like you are using a 32 bit JVM. Java requires a single block of contiguous memory for its heap, and depending on the OS it is limited to 1.2 to 1.6 GB depending on your OS, regardless of the amount of your memory.

If you use a 64-bit JVM, you do not have this problem.

+5
source

refer to this topic Maximum Maximum Java Memory in Windows XP

Also my favorite article on this subject. Thanks for the memory.

edit: replace first link, sorry

+1
source

Source: https://habr.com/ru/post/896154/


All Articles