> > 1. Why Cassandra memory usage remains high even if no traffic is run? > 2. In which case I will get above error ( *java.lang.OutOfMemoryError: > Direct buffer memory*). How to avoid those cases? >
I don't have enough information to know if it applies to your case but there's a good possibility that your SSTables are getting mapped to memory and it's causing high memory usage. There's a hidden property called disk_access_mode that determines how SSTables are accessed. In older versions of C*, the behaviour was to only mmap() index files. But with the added support for direct buffer compressing in C* 2.2, both data and index files are getting mapped to memory when they get accessed. I've explained it in a bit more detail in this KB article -- https://support.datastax.com/hc/en-us/articles/360027838911. Note that it specifically mentions DSE 5.0 and 5.1 but it equally applies to C* 3.0 through to 3.11. The solution is to add this line to cassandra.yaml and restart C*: disk_access_mode: mmap_index_only If it's the cause of the symptoms you described, you'd be able to see significantly less memory usage than before. Cheers! GOT QUESTIONS? Apache Cassandra experts from the community and DataStax have answers! Share your expertise on https://community.datastax.com/.