cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mohammed Guller <>
Subject Cassandra terminates with OutOfMemory (OOM) error
Date Fri, 21 Jun 2013 17:49:14 GMT
We have a 3-node cassandra cluster on AWS. These nodes are running cassandra 1.2.2 and have
8GB memory. We didn't change any of the default heap or GC settings. So each node is allocating
1.8GB of heap space. The rows are wide; each row stores around 260,000 columns. We are reading
the data using Astyanax. If our application tries to read 80,000 columns each from 10 or more
rows at the same time, some of the nodes run out of heap space and terminate with OOM error.
Here is the error message:

java.lang.OutOfMemoryError: Java heap space
        at java.nio.HeapByteBuffer.duplicate(
        at org.apache.cassandra.db.marshal.AbstractCompositeType.getBytes(
        at org.apache.cassandra.db.marshal.AbstractCompositeType.getWithShortLength(
        at org.apache.cassandra.db.marshal.AbstractCompositeType.split(
        at org.apache.cassandra.db.filter.ColumnCounter$GroupByPrefix.count(
        at org.apache.cassandra.db.filter.SliceQueryFilter.collectReducedColumns(
        at org.apache.cassandra.db.filter.QueryFilter.collateColumns(
        at org.apache.cassandra.db.filter.QueryFilter.collateOnDiskAtom(
        at org.apache.cassandra.db.CollationController.collectAllData(
        at org.apache.cassandra.db.CollationController.getTopLevelColumns(
        at org.apache.cassandra.db.ColumnFamilyStore.getTopLevelColumns(
        at org.apache.cassandra.db.ColumnFamilyStore.getColumnFamily(
        at org.apache.cassandra.db.ColumnFamilyStore.getColumnFamily(
        at org.apache.cassandra.db.Table.getRow(
        at org.apache.cassandra.db.SliceFromReadCommand.getRow(
       at org.apache.cassandra.service.StorageProxy$LocalReadRunnable.runMayThrow(
        at org.apache.cassandra.service.StorageProxy$
        at java.util.concurrent.ThreadPoolExecutor.runWorker(
        at java.util.concurrent.ThreadPoolExecutor$

ERROR 02:14:05,351 Exception in thread Thread[Thrift:6,5,main]
java.lang.OutOfMemoryError: Java heap space
        at java.lang.Long.toString(
        at java.lang.Long.toString(
        at org.apache.cassandra.dht.Murmur3Partitioner$1.toString(
        at org.apache.cassandra.service.StorageService.describeRing(
        at org.apache.cassandra.thrift.CassandraServer.describe_ring(
        at org.apache.cassandra.thrift.Cassandra$Processor$describe_ring.getResult(
        at org.apache.cassandra.thrift.Cassandra$Processor$describe_ring.getResult(
        at org.apache.thrift.ProcessFunction.process(
        at org.apache.thrift.TBaseProcessor.process(
        at org.apache.cassandra.thrift.CustomTThreadPoolServer$
        at java.util.concurrent.ThreadPoolExecutor.runWorker(
        at java.util.concurrent.ThreadPoolExecutor$

The data in each column is less than 50 bytes. After adding all the column overheads (column
name + metadata), it should not be more than 100 bytes. So reading 80,000 columns from 10
rows each means that we are reading 80,000 * 10 * 100 = 80 MB of data. It is large, but not
large enough to fill up the 1.8 GB heap. So I wonder why the heap is getting full. If the
data request is too big to fill in a reasonable amount of time, I would expect Cassandra to
return a TimeOutException instead of terminating.

One easy solution is to increase the heapsize. However that means Cassandra can still crash
if someone reads 100 rows.  I wonder if there some other Cassandra setting that I can tweak
to prevent the OOM exception?


View raw message