0

On a 6 node cassandra cluster, heap size is configured as 31g. When I run nodetool info, I see below

Nodetool info - 
[root@ip-10-216-86-94 ~]# nodetool info
ID                     : 88esdsd01-5233-4b56-a240-ea051ced2928
Gossip active          : true
Thrift active          : false
Native Transport active: true
Load                   : 53.31 GiB
Generation No          : 1549564460
Uptime (seconds)       : 734
Heap Memory (MB)       : 828.45 / 31744.00
Off Heap Memory (MB)   : 277.25
Data Center            : us-east
Rack                   : 1a
Exceptions             : 0
Key Cache              : entries 8491, size 1.12 MiB, capacity 100 MiB, 35299 hits, 44315 requests, 0.797 recent hit rate, 14400 save period in seconds
Row Cache              : entries 0, size 0 bytes, capacity 0 bytes, 0 hits, 0 requests, NaN recent hit rate, 0 save period in seconds
Counter Cache          : entries 5414, size 1.22 MiB, capacity 50 MiB, 5387 hits, 10801 requests, 0.499 recent hit rate, 7200 save period in seconds
Chunk Cache            : entries 6164, size 249.5 MiB, capacity 480 MiB, 34840 misses, 177139 requests, 0.803 recent hit rate, 121.979 microseconds miss latency
Percent Repaired       : 0.0%
Token                  : (invoke with -T/--tokens to see all 8 tokens)

Heap memory used and allocated maps to what I see on jconsole. But for non-heap memory, on jconsole it shows 188mb whereas from info command it shows 277mb, why is there a mismatch?

nmakb
  • 1,069
  • 1
  • 17
  • 35
  • Please don't combine several unrelated questions into one. I mean the subquestions about connections and threads have nothing to do with the title "how is memory allocated in cassandra". – apangin Feb 07 '19 at 21:54
  • As to the memory topic, [this answer](https://stackoverflow.com/a/53624438/3448419) should explain the situation. Cassandra heavily relies on memory-mapped files. Neither "Heap" nor "Non-heap" metrics in JConsole include memory-mapped files. – apangin Feb 07 '19 at 22:02
  • "Non-heap" memory in JConsole and "Off Heap Memory" shown by nodetool are completely different things. The former is a [JVM metrics](https://stackoverflow.com/a/39330095/3448419) that includes Metaspace and Code Cache size, while the latter is the total size of Bloom filters, Index Summary and Compression Metadata of Cassandra column families. – apangin Feb 07 '19 at 22:13
  • try installing [Opscenter](https://www.datastax.com/products/datastax-opscenter) to see all the memory usages on each nodes, you can see historical usage of data & memory on it's dashboard by creating various charts. – Anil Kapoor Feb 08 '19 at 05:02
  • @apangin Thanks for the helpful links. Separated questions as you suggested. – nmakb Feb 08 '19 at 10:57

1 Answers1

0

Non-Heap Memory in JConsole and Off Heap Memory shown by nodetool are completely different things.

  1. Non-Heap Memory in JConsole is the sum of JVM non-heap memory pools. JVM exports this information through MemoryPoolMXBean. As of JDK 8, these pools include:

    • Metaspace
    • Compressed Class Space
    • Code Cache

So, Non-Heap pools show how much memory JVM uses for class metadata and compiled code.

  1. Nodetool gets Off Heap Memory stats from Cassandra's Column Family Metrics. This is the the total size of Bloom filters, Index Summaries and Compression Metadata for all open tables.
    See nodetool tablestats for detailed breakdown of this statistics.
apangin
  • 92,924
  • 10
  • 193
  • 247