You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Jonathan Ellis (JIRA)" <ji...@apache.org> on 2012/10/02 15:55:07 UTC

[jira] [Resolved] (CASSANDRA-4743) Range slice query causes OOM

     [ https://issues.apache.org/jira/browse/CASSANDRA-4743?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jonathan Ellis resolved CASSANDRA-4743.
---------------------------------------

    Resolution: Not A Problem

Make your requests with the real limit you need, not an insanely high one.
                
> Range slice query causes OOM 
> -----------------------------
>
>                 Key: CASSANDRA-4743
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4743
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.1.5
>            Reporter: Andrey Ilinykh
>
> I got OOM error. The log is
> ERROR [ReadStage:42] 2012-09-30 07:54:55,069 AbstractCassandraDaemon.java (line 135) Exception in thread Thread[ReadStage:42,5,main]
> java.lang.OutOfMemoryError: Java heap space
>         at org.apache.cassandra.io.util.FastByteArrayOutputStream.<init>(FastByteArrayOutputStream.java:76)
>         at org.apache.cassandra.io.util.DataOutputBuffer.<init>(DataOutputBuffer.java:40)
>         at org.apache.cassandra.db.RangeSliceReply.getReply(RangeSliceReply.java:48)
>         at org.apache.cassandra.service.RangeSliceVerbHandler.doVerb(RangeSliceVerbHandler.java:64)
>         at org.apache.cassandra.net.MessageDeliveryTask.run(MessageDeliveryTask.java:59)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>         at java.lang.Thread.run(Thread.java:662)
> The RangeSliceReply#getReply()
> method gets all rows, calculates total size and then try to allocate output buffer. There is no check done on total size, it could be very large.
> public Message getReply(Message originalMessage) throws IOException
>     {
>         int size = DBConstants.intSize;
>         for (Row row : rows)
>             size += Row.serializer().serializedSize(row, originalMessage.getVersion());
>         DataOutputBuffer buffer = new DataOutputBuffer(size);
>         buffer.writeInt(rows.size());
>         for (Row row : rows)
>             Row.serializer().serialize(row, buffer, originalMessage.getVersion());
>         assert buffer.getLength() == buffer.getData().length;
>         return originalMessage.getReply(FBUtilities.getBroadcastAddress(), buffer.getData(), originalMessage.getVersion());
>     }

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira