Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.Original topic: RocksDB 的内存占用计算中1个疑问

[TiDB Usage Environment] Production Environment / Testing / PoC
Testing
[TiDB Version]
v6.1.0
[Reproduction Path] What operations were performed when the issue occurred
A question about memory usage calculation in RocksDB
[Encountered Issue: Problem Phenomenon and Impact]
Document description:
Data written to RocksDB is written to the MemTable. When the size of a MemTable exceeds 128MB, it switches to a new MemTable for writing. There are a total of 2 RocksDB instances in TiKV, with a total of 4 ColumnFamilies. The size limit for a single MemTable in each ColumnFamily is 128MB, and a maximum of 5 MemTables are allowed, otherwise, it will block foreground writes. Therefore, the maximum memory occupied by this part is 4 x 5 x 128MB = 2.5GB.
Question 1:
There are a total of 2 RocksDB instances in TiKV, with a total of 4 ColumnFamilies. Is it 4 ColumnFamilies or 5 ColumnFamilies?
[Resource Configuration]
[Attachment: Screenshot/Log/Monitoring]
Document: RocksDB 简介 | PingCAP 文档中心