我们正在测试Cassandra,作为项目的一部分,我们将图像(机密图像不能放在磁盘上)直接保存到数据库中。
我们在8分钟内保存了380张909 MB的图片,没有任何问题。
堆大小设置如下。
MAX_HEAP_SIZE="4G"
HEAP_NEWSIZE="1024M"
表的总大小为822 MB。
问题是,当我尝试获取1条记录时,它会运行罚款,当我将搜索增加到1到4之间的ID时,我得到以下错误。
INFO 12:51:52 ConcurrentMarkSweep GC in 228ms. CMS Old Gen: 172017888 ->
200306216; Par Eden Space: 53693192 -> 30464688; Par Survivor Space: 6681832 -> 0
java.lang.OutOfMemoryError: Java heap space
Dumping heap to java_pid2548.hprof ...
INFO 12:51:55 ConcurrentMarkSweep GC in 452ms. CMS Old Gen: 200301712 -> 200301512; Par Eden Space: 53284648 -> 52721832;
Heap dump file created [275541785 bytes in 2.173 secs]
ERROR 12:51:55 Exception in thread Thread[MessagingService-Incoming-/192.168.0.46,5,main]
java.lang.OutOfMemoryError: Java heap space
at org.apache.cassandra.utils.ByteBufferUtil.read(ByteBufferUtil.java:350) ~[apache-cassandra-2.1.8.jar:2.1.8]
at org.apache.cassandra.utils.ByteBufferUtil.readWithLength(ByteBufferUtil.java:311) ~[apache-cassandra-2.1.8.jar:2.1.8]
at org.apache.cassandra.db.ColumnSerializer.deserializeColumnBody(ColumnSerializer.java:132) ~[apache-cassandra-2.1.8.jar:2.1.8]
at org.apache.cassandra.db.ColumnSerializer.deserialize(ColumnSerializer.java:109) ~[apache-cassandra-2.1.8.jar:2.1.8]
at org.apache.cassandra.db.ColumnSerializer.deserialize(ColumnSerializer.java:101) ~[apache-cassandra-2.1.8.jar:2.1.8]
at org.apache.cassandra.db.ColumnFamilySerializer.deserialize(ColumnFamilySerializer.java:110) ~[apache-cassandra-2.1.8.jar:2.1.8]
at org.apache.cassandra.db.ColumnFamilySerializer.deserialize(ColumnFamilySerializer.java:89) ~[apache-cassandra-2.1.8.jar:2.1.8]
at org.apache.cassandra.db.Row$RowSerializer.deserialize(Row.java:74) ~[apache-cassandra-2.1.8.jar:2.1.8]
at org.apache.cassandra.db.Row$RowSerializer.deserialize(Row.java:79) ~[apache-cassandra-2.1.8.jar:2.1.8]
at org.apache.cassandra.db.RangeSliceReply$RangeSliceReplySerializer.deserialize(RangeSliceReply.java:77) ~[apache-cassandra-2.1.8.jar:2.1.8]
at org.apache.cassandra.db.RangeSliceReply$RangeSliceReplySerializer.deserialize(RangeSliceReply.java:63) ~[apache-cassandra-2.1.8.jar:2.1.8]
at org.apache.cassandra.net.MessageIn.read(MessageIn.java:99) ~[apache-cassandra-2.1.8.jar:2.1.8]
at org.apache.cassandra.net.IncomingTcpConnection.receiveMessage(IncomingTcpConnection.java:188) ~[apache-cassandra-2.1.8.jar:2.1.8]
at org.apache.cassandra.net.IncomingTcpConnection.receiveMessages(IncomingTcpConnection.java:170) ~[apache-cassandra-2.1.8.jar:2.1.8]
at org.apache.cassandra.net.IncomingTcpConnection.run(IncomingTcpConnection.java:88) ~[apache-cassandra-2.1.8.jar:2.1.8]
java.lang.OutOfMemoryError: Java heap space
at org.apache.cassandra.utils.ByteBufferUtil.read(ByteBufferUtil.java:350)
at org.apache.cassandra.utils.ByteBufferUtil.readWithLength(ByteBufferUtil.java:311)
at org.apache.cassandra.db.ColumnSerializer.deserializeColumnBody(ColumnSerializer.java:132)
at org.apache.cassandra.db.ColumnSerializer.deserialize(ColumnSerializer.java:109)
at org.apache.cassandra.db.ColumnSerializer.deserialize(ColumnSerializer.java:101)
at org.apache.cassandra.db.ColumnFamilySerializer.deserialize(ColumnFamilySerializer.java:110)
at org.apache.cassandra.db.ColumnFamilySerializer.deserialize(ColumnFamilySerializer.java:89)
at org.apache.cassandra.db.Row$RowSerializer.deserialize(Row.java:74)
at org.apache.cassandra.db.Row$RowSerializer.deserialize(Row.java:79)
at org.apache.cassandra.db.RangeSliceReply$RangeSliceReplySerializer.deserialize(RangeSliceReply.java:77)
at org.apache.cassandra.db.RangeSliceReply$RangeSliceReplySerializer.deserialize(RangeSliceReply.java:63)
at org.apache.cassandra.net.MessageIn.read(MessageIn.java:99)
at org.apache.cassandra.net.IncomingTcpConnection.receiveMessage(IncomingTcpConnection.java:188)
at org.apache.cassandra.net.IncomingTcpConnection.receiveMessages(IncomingTcpConnection.java:170)
at org.apache.cassandra.net.IncomingTcpConnection.run(IncomingTcpConnection.java:88)
ERROR 12:51:56 JVM state determined to be unstable. Exiting forcefully due to:
java.lang.OutOfMemoryError: Java heap space
at org.apache.cassandra.utils.ByteBufferUtil.read(ByteBufferUtil.java:350) ~[apache-cassandra-2.1.8.jar:2.1.8]
at org.apache.cassandra.utils.ByteBufferUtil.readWithLength(ByteBufferUtil.java:311) ~[apache-cassandra-2.1.8.jar:2.1.8]
at org.apache.cassandra.db.ColumnSerializer.deserializeColumnBody(ColumnSerializer.java:132) ~[apache-cassandra-2.1.8.jar:2.1.8]
at org.apache.cassandra.db.ColumnSerializer.deserialize(ColumnSerializer.java:109) ~[apache-cassandra-2.1.8.jar:2.1.8]
at org.apache.cassandra.db.ColumnSerializer.deserialize(ColumnSerializer.java:101) ~[apache-cassandra-2.1.8.jar:2.1.8]
at org.apache.cassandra.db.ColumnFamilySerializer.deserialize(ColumnFamilySerializer.java:110) ~[apache-cassandra-2.1.8.jar:2.1.8]
at org.apache.cassandra.db.ColumnFamilySerializer.deserialize(ColumnFamilySerializer.java:89) ~[apache-cassandra-2.1.8.jar:2.1.8]
at org.apache.cassandra.db.Row$RowSerializer.deserialize(Row.java:74) ~[apache-cassandra-2.1.8.jar:2.1.8]
at org.apache.cassandra.db.Row$RowSerializer.deserialize(Row.java:79) ~[apache-cassandra-2.1.8.jar:2.1.8]
at org.apache.cassandra.db.RangeSliceReply$RangeSliceReplySerializer.deserialize(RangeSliceReply.java:77) ~[apache-cassandra-2.1.8.jar:2.1.8]
at org.apache.cassandra.db.RangeSliceReply$RangeSliceReplySerializer.deserialize(RangeSliceReply.java:63) ~[apache-cassandra-2.1.8.jar:2.1.8]
at org.apache.cassandra.net.MessageIn.read(MessageIn.java:99) ~[apache-cassandra-2.1.8.jar:2.1.8]
at org.apache.cassandra.net.IncomingTcpConnection.receiveMessage(IncomingTcpConnection.java:188) ~[apache-cassandra-2.1.8.jar:2.1.8]
at org.apache.cassandra.net.IncomingTcpConnection.receiveMessages(IncomingTcpConnection.java:170) ~[apache-cassandra-2.1.8.jar:2.1.8]
at org.apache.cassandra.net.IncomingTcpConnection.run(IncomingTcpConnection.java:88) ~[apache-cassandra-2.1.8.jar:2.1.8]
INFO 12:51:56 ConcurrentMarkSweep GC in 454ms. CMS Old Gen: 200295432 -> 73311840; Par Eden Space: 53739520 -> 0; Par Survivor Space: 6684672 -> 0