To add on to my previous email, I think we get this error when actual off heap memory breaches "off heap memory limit" as mentioned in this JIRA <https://issues.apache.org/jira/browse/CASSANDRA-10930>.
On Mon, Mar 30, 2020 at 3:10 PM manish khandelwal < manishkhandelwa...@gmail.com> wrote: > I have already updated that property to mmap_index_only. And in pmap I > could see only index files are loaded into memory not the SSTables. > I feel this is some to do with direct memory buffer. There is a > opened JIRA ticket https://issues.apache.org/jira/browse/CASSANDRA-10930 as > well regarding this. > > On Mon, Mar 30, 2020 at 2:05 PM Erick Ramirez <erick.rami...@datastax.com> > wrote: > >> 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/. >> >>