1
votes

Error: Could not create the Java Virtual Machine.

Error: A fatal exception has occurred. Program will exit.

Invalid maximum heap size: -Xmx4096M

The specified size exceeds the maximum representable size.

Process finished with exit code 1

i have this error when i start to excute my program with intellji

in edite configration i change Vm options to :

-ea -Dmodules=core,tables,corenlp -Xms4096M -Xmx4096M .

i want to read some large data and it give me this error

i change the value to -Xms4095M -Xmx4095M it give me error when excute

Error occurred during initialization of VM

Could not reserve enough space for 4188160KB object heap

this program want a 5G of ram

i have 2 ram 4G and the win7 let me use all of 8G.

but here i cant put a value bigger than 4095M !! how i can solve it?

1
I suppose that you use 32 bit version of java. Try run idea64.exe - talex
Change your project SDK to 64-bit version. - CrazyCoder
thanks everybody , yes my sdk version is 32 bit .. i instal 64 bit and it works - Ehsan Hadri

1 Answers

0
votes

Error: Intellij heap size snap

This answer is only for the linux/debian users.

So, I changed the max heap size from 750m to 2048m. When i changed this, I was unable to start the intellij.

Invalid maximum heap size: -Xmx2048m
The specified size exceeds the maximum representable size.
Could not create the Java virtual machine.

I installed the intellij by the help of snap. So, the contents of all the snaps where installed at /snap/intellij.

These contents were read-only. So, you cannot change the vmoptions here.

The actual customized vmoptions is present in the user directory.

The name of the directory is .IntelliJIdea{Year.Version}/config. Some of the operating systems hide this directory. So, you need to enable show the hidden files

Now, you will find the idea64.vmoptions file. Edit this file to the decrease the memory.