title: When Cassandra is running almost all RAM is consumed, why?
body: <p>I have CentOS 6.8, Cassandra 3.9, 32 GB RAM. When I start Cassandra and once it is started, it starts consuming the memory and start adding up 'Cached' memory value when I start querying from CQLSH or Apache Spark and  in this process, very less memory remain for other processing like cron execution.</p>
  
  <p>Here are some details from my system</p>
  
  <pre><code>free -m
           total       used       free     shared    buffers     cached
  Mem:         32240      32003        237          0         41      24010
  -/+ buffers/cache:       7950      24290
  Swap:         2047         25       2022
  </code></pre>
  
  <p>And here is the output of top -M command</p>
  
  <pre><code>top - 08:54:39 up 5 days, 16:24,  4 users,  load average: 1.22, 1.20, 1.29
  Tasks: 205 total,   2 running, 203 sleeping,   0 stopped,   0 zombie
  Cpu(s):  3.5%us,  1.2%sy, 19.8%ni, 75.3%id,  0.1%wa,  0.1%hi,  0.0%si,  0.0%st
  Mem:    31.485G total,   31.271G used,  219.410M free,   42.289M buffers
  Swap: 2047.996M total,   25.867M used, 2022.129M free,   23.461G cached
  
  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
  14313 cassandr  20   0  595g  28g  22g S 144.5 91.3 300:56.34 java
  </code></pre>
  
  <p>You can see only 220 MB is left and 23.46 is cached. </p>
  
  <p>My question is how to configure Cassandra so that it can use 'cached' memory to certain value and leave more RAM available for other processes.</p>
  
  <p>Thanks in advance.</p>