Cassandra generates the error "java.lang.OutOfMemoryError: Java heap space" at startup

I updated my system from 13.04 to 13.10, and I could no longer start Cassandra, getting an error from memory, so the heap was full, although everything I was doing at that moment started from the server.

I logged in and increased the maximum heap size from -Xmx1992m (default) to -Xms2500m.

I wonder why this should be done? Maybe the memory has slightly decreased between the launch of the Linux 3.5.0 kernel and the transition to the 3.11.0 kernel, and can this affect Cassandra? (ie I "lost" 200M, now it allocated 1992Mb instead of 2192Mb with the previous core, could it be?)

My concern is that at any time when I upgrade, I could work with such a problem if I did not impose the maximum heap size on a fixed number (instead of letting the script determine what MB would use dynamically.) Also, I just don’t may continue to increase the limit forever. My RAM is limited ... (obviously.)

At startup, Cassandra shows the following (broken into 3 lines to make reading easier here):

xss =  -ea -javaagent:bin/../lib/jamm-0.2.5.jar -XX:+UseThreadPriorities
       -XX:ThreadPriorityPolicy=42 -Xms1994M -Xmx2500M -Xmn400M
       -XX:+HeapDumpOnOutOfMemoryError -Xss256k

Update:

Argh! It was still running OpenVMS because the $ JAVA_HOME variable points to / usr / lib / jvm / default -java (defined in / etc / environment):

JAVA_HOME=/usr/lib/jvm/default-java

- OpenVMS. /etc/alternatives/java, , , java -version " " ( , ), Cassandra script $JAVA_HOME!

, :

ls -l /usr/lib/jvm

lrwxrwxrwx 1 root root   24 Apr 27  2012 default-java -> java-1.7.0-openjdk-amd64
drwxr-xr-x 4 root root 4096 Feb 23 17:54 java-1.5.0-gcj-4.8-amd64
lrwxrwxrwx 1 root root   20 Sep  2  2012 java-1.6.0-openjdk-amd64 -> java-6-openjdk-amd64
lrwxrwxrwx 1 root root   20 Jul  3  2013 java-1.7.0-openjdk-amd64 -> java-7-openjdk-amd64
drwxr-xr-x 5 root root 4096 Oct  7  2012 java-6-openjdk-amd64
drwxr-xr-x 3 root root 4096 Oct  7  2012 java-6-openjdk-common
drwxr-xr-x 5 root root 4096 Sep 21 20:06 java-7-openjdk-amd64
drwxr-xr-x 8 root root 4096 Sep 18 21:18 java-7-oracle

Oracle:

sudo rm /usr/lib/jvm/default-java
sudo ln -s java-7-oracle /usr/lib/jvm/default-java

, , .

+4
1

, , ​​Java, . , , .

, . , .., . , , , - - .

- , , , .

+2

All Articles