I am getting the following exception repeatedly each time I try to run the program.
Error occurred during initialization of VM
Could not reserve e
This can also be caused by setting something too large on a 32-bit HotSpot vm, for example:
-Xms1536m -Xmx1536m
where this might/would work:
-Xms1336m -Xmx1336m
In CASSANDRA_HOME/bin/cassandra.bat you would find following configuration
REM JVM Opts we'll use in legacy run or installation
set JAVA_OPTS=-ea^
-javaagent:"%CASSANDRA_HOME%\lib\jamm-0.3.0.jar"^
-Xms**2G**^
-Xmx**2G**^
You can reduce 2G to some smaller number for e.g. 1G or even lesser and it should work.
Same if you are running on unix box, change in .sh file appropriately.
Sometimes it relates as
$ sysctl vm.overcommit_memory
vm.overcommit_memory = 2
If you set it to:
$ sysctl vm.overcommit_memory=0
It should work.
No need to do anything just chnage in POM file like below
<configuration>
<maxmemory>1024M</maxmemory>
</configuration>
Replace -Xmx2G
with -Xms512M
or any greater memory size in cassandra.bat file in cassandra bin directory.
I had right amount of memory settings but for me it was using a 64bit intellij with 32 bit jvm. Once I switched to 64 bit VM, the error was gone.