A way to read all the db without having an OOM is to limit the amount
of rows to be returned, and to iterate over the query, the starting
key being the last returned key. Note that doing that way the first
key of the next iteration is the same as the last key of the preivous
iteration.

The warning in SliceRange can also be applied for this function :

http://wiki.apache.org/cassandra/API
"How many columns to return. Similar to LIMIT 100 in SQL. May be
arbitrarily large, but Thrift will materialize the whole result into
memory before returning it to the client, so be aware that you may be
better served by iterating through slices by passing the last value of
one call in as the start of the next instead of increasing count
arbitrarily large."

Kind regards,

Benoit.

2010/4/2 Gautam Singaraju <gautam.singar...@gmail.com>:
> I call the get_range_slice method in Java to get the list of all keys
> in Cassandra db. The db is pretty small, about 1.3GB on disk. I
> received the following error on the server:
>
> "java.lang.OutOfMemoryError: Requested array size exceeds VM limit"
>
> I changed the JVM size from 1 GB to 2 GB in
> cassandra/bin/cassandra.in.sh. But, the error still persists.
>
> Any help will be much appreciated.
> ---
> Gautam
>

Reply via email to