yugabyte / yugabyte-db

YugabyteDB - the cloud native distributed SQL database for mission-critical applications.
https://www.yugabyte.com
Other
8.69k stars 1.04k forks source link

[DocDB] Improve memory tracking and metrics #3442

Open ttyusupov opened 4 years ago

ttyusupov commented 4 years ago

Jira Link: DB-2092 1) We currently use TCMalloc <generic.heap_size> - <tcmalloc.pageheap_unmapped_bytes> as root mem tracker consumption. This equals to <generic.total_physical_bytes> - <stats.metadata_bytes>. Do we need to include stats.metadata_bytes as well, so root mem tracker reports <generic.total_physical_bytes>?

2) Currently, the root mem tracker is not exposed as a metric, we need to add it.

yusong-yan commented 6 months ago

Root consumption is equal to <generic.total_physical_bytes> - <stats.metadata_bytes> when Gperftools tcmalloc is used But if Google tcmalloc is used, the total physical bytes calculation is a little different (check source code), total physical bytes is equal to <current root consumption> + <stats.metadata_bytes> + <stats.arena.bytes_unallocated> + <stats.arena.bytes_unavailable>