Could not reserve enough space for object heap

后端 未结 26 1314
余生分开走
余生分开走 2020-11-22 05:59

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

相关标签:
26条回答
  • 2020-11-22 06:50

    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
    
    0 讨论(0)
  • 2020-11-22 06:50

    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.

    0 讨论(0)
  • 2020-11-22 06:50

    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.

    0 讨论(0)
  • 2020-11-22 06:52

    No need to do anything just chnage in POM file like below

    <configuration>
        <maxmemory>1024M</maxmemory>
    </configuration>
    
    0 讨论(0)
  • 2020-11-22 06:53

    Replace -Xmx2G with -Xms512M or any greater memory size in cassandra.bat file in cassandra bin directory.

    0 讨论(0)
  • 2020-11-22 06:55

    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.

    0 讨论(0)
提交回复
热议问题