I have configured Cassandra 2.0.4 in my laptop which was working fine for few weeks. My machine configuration is below -
On a day-2-day basis, I have been truncating the database and recreating frequently. After few weeks, when I tried to start Cassandra, I started getting the below error -
java.lang.OutOfMemoryError: Java heap space
at org.apache.cassandra.io.compress.CompressedRandomAccessReader.<init>(CompressedRandomAccessReader.java:64)
at org.apache.cassandra.io.compress.CompressedRandomAccessReader.open(CompressedRandomAccessReader.java:44)
at org.apache.cassandra.io.sstable.SSTableReader.openDataReader(SSTableReader.java:949)
at org.apache.cassandra.io.sstable.SSTableScanner.<init>(SSTableScanner.java:72)
at org.apache.cassandra.io.sstable.SSTableReader.getScanner(SSTableReader.java:796)
at org.apache.cassandra.db.RowIteratorFactory.getIterator(RowIteratorFactory.java:88)
at org.apache.cassandra.db.ColumnFamilyStore.getRangeSlice(ColumnFamilyStore.java:1329)
at org.apache.cassandra.service.StorageProxy.getRangeSlice(StorageProxy.java:806)
at org.apache.cassandra.thrift.CassandraServer.get_range_slices(CassandraServer.java:697)
at org.apache.cassandra.thrift.Cassandra$Processor$get_range_slices.process(Cassandra.java:3202)
at org.apache.cassandra.thrift.Cassandra$Processor.process(Cassandra.java:2889)
at org.apache.cassandra.thrift.CustomTThreadPoolServer$WorkerProcess.run(CustomTThreadPoolServer.java:187)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:636)
I have made the below changes to Cassandra.bat and the problem got resolved.
I have updated the two highlighted values from -Xms1G^, -Xmx1G^ to -Xms2G^, -Xmx2G^ by allocating 2GB of heap memory for Cassandra.
On a day-2-day basis, I have been truncating the database and recreating frequently. After few weeks, when I tried to start Cassandra, I started getting the below error -
java.lang.OutOfMemoryError: Java heap space
at org.apache.cassandra.io.compress.CompressedRandomAccessReader.<init>(CompressedRandomAccessReader.java:64)
at org.apache.cassandra.io.compress.CompressedRandomAccessReader.open(CompressedRandomAccessReader.java:44)
at org.apache.cassandra.io.sstable.SSTableReader.openDataReader(SSTableReader.java:949)
at org.apache.cassandra.io.sstable.SSTableScanner.<init>(SSTableScanner.java:72)
at org.apache.cassandra.io.sstable.SSTableReader.getScanner(SSTableReader.java:796)
at org.apache.cassandra.db.RowIteratorFactory.getIterator(RowIteratorFactory.java:88)
at org.apache.cassandra.db.ColumnFamilyStore.getRangeSlice(ColumnFamilyStore.java:1329)
at org.apache.cassandra.service.StorageProxy.getRangeSlice(StorageProxy.java:806)
at org.apache.cassandra.thrift.CassandraServer.get_range_slices(CassandraServer.java:697)
at org.apache.cassandra.thrift.Cassandra$Processor$get_range_slices.process(Cassandra.java:3202)
at org.apache.cassandra.thrift.Cassandra$Processor.process(Cassandra.java:2889)
at org.apache.cassandra.thrift.CustomTThreadPoolServer$WorkerProcess.run(CustomTThreadPoolServer.java:187)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:636)
I have made the below changes to Cassandra.bat and the problem got resolved.
I have updated the two highlighted values from -Xms1G^, -Xmx1G^ to -Xms2G^, -Xmx2G^ by allocating 2GB of heap memory for Cassandra.