cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anthony Molinaro <>
Subject OOM on restart
Date Thu, 11 Feb 2010 18:11:18 GMT

  I've been having nodes failing recently with OOM exceptions (not sure
why, but we have had an increase in traffic so that could be a cause).
Most nodes have restarted fine, one node however, has been having problems
restarting.  It was failing with

java.lang.OutOfMemoryError: Java heap space
        at java.util.Arrays.copyOfRange(
        at java.lang.String.<init>(
        at org.apache.cassandra.db.ColumnFamilySerializer.deserialize(
        at org.apache.cassandra.db.RowMutationSerializer.defreezeTheMaps(
        at org.apache.cassandra.db.RowMutationSerializer.deserialize(
        at org.apache.cassandra.db.RowMutationSerializer.deserialize(
        at org.apache.cassandra.db.CommitLog.recover(
        at org.apache.cassandra.db.RecoveryManager.doRecovery(
        at org.apache.cassandra.service.CassandraDaemon.setup(
        at org.apache.cassandra.service.CassandraDaemon.main(


java.lang.OutOfMemoryError: Java heap space
        at java.lang.StringCoding.encode(
        at java.lang.StringCoding.encode(
        at java.lang.String.getBytes(
        at org.apache.cassandra.utils.FBUtilities.hash(
        at org.apache.cassandra.dht.RandomPartitioner.getToken(
        at org.apache.cassandra.dht.RandomPartitioner.decorateKey(
        at org.apache.cassandra.db.Memtable.resolve(
        at org.apache.cassandra.db.Memtable.put(
        at org.apache.cassandra.db.ColumnFamilyStore.apply(
        at org.apache.cassandra.db.Table.apply(
        at org.apache.cassandra.db.CommitLog$
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(
        at java.util.concurrent.ThreadPoolExecutor$

I upped the Xmx value from 4G to 6G and it seems to be doing okay, however
it seems odd that it can run mostly fine with 4G, but fail to restart with
that much memory.  Maybe this ticket's issue is back?

Anyway, I'm hoping thing will recover with 6G then I can restart again with 4G and things
will be good.

I'd also like a better understanding of why cassandra might OOM in general.
Are there settings which minimize the chances of OOM?  This instance has
2 column families and I have 


So if I understand these settings, memtables can at most be 512MB in size
or consist of 1 million objects before they are flushed to disk.  The maximum
time before they will be flushed is 24 hours.  So does that mean if I fill
up 8G or 16 memtables in less than 24 hours, I've basically used all the
memory available to me?  I assume there are other things using memory,
(indexes, etc), how is that limited?  Anyway, any information about what
is used where would be appreciated.



Anthony Molinaro                           <>

View raw message