juan
juan

Reputation: 81932

Which memory does Cassandra use for Row Cache?

Does it use the heap memory or the remaining server memory?

I have a server with 32 GB of RAM, I initialised Cassandra with a 25 GB MAX_HEAP_SIZE and I specified a Row Cache capacity of 20 GB.

Am I correctly assuming Row Cache uses the heap memory I initialised the process with? Or is my configuration expecting the server to have at least 45 GB of ram?

Upvotes: 1

Views: 918

Answers (2)

John
John

Reputation: 1462

This row key documentation states that there are 2 actual row_cache_provider implementations:

SerializingCacheProvider: Serializes the contents of the row and stores it in native memory, that is, off the JVM Heap

and

ConcurrentLinkedHashCacheProvider: Rows are cached using the JVM heap, providing the same row cache behavior as Cassandra versions prior to 0.8.

The default is SerializingCacheProvider so if you don't change it, row cache does not use the JVM Heap memory.

Upvotes: 3

nanofarad
nanofarad

Reputation: 41281

Looking at the source, the row cache is an ICache, which is put onto the heap as per its being an object without special treatment.

You may perform further tests to ascertain the true performance and memory handling.

Upvotes: 0

Related Questions