Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.
Original topic: TiKV服务器的【可用内存】从6G突然增加到200G。 是TiKV自己会清理内存么?
[TiDB Usage Environment] Production Environment
[TiDB Version] v3.0.12
Description:
In the Grafana available memory view, I observed that the available memory of a TiKV instance increased from 6G to over 200G within 2 minutes.
What could be the reason for this? Does TiKV automatically release memory when it reaches a certain threshold? Where is this threshold set, and why wasn’t the memory released in a timely manner before?
Grafana available memory screenshot
After TiKV’s memory usage increases, it will continue to occupy that much memory without any changes. Unless you restart TiKV.
This sudden large-scale release of memory may be due to TiKV restarting after an OOM (Out of Memory) event. You need to check the tikv.log.
Let me ask a question: Will there be data loss if TiKV restarts? I understand that the data should have already been persisted to disk. Additionally, TiKV has multiple instances and replicas; there shouldn’t be any data loss issues, right?
A single TiKV restart will not result in data loss, but the Region Leader originally located on that instance will undergo re-election, which may cause a slight performance jitter.
Go check if TiKV suddenly ran out of memory. The method to check is:
- Execute the command
dmesg -T | grep 'tikv-server'
on the corresponding TiKV node to see if there is any output information.
This topic was automatically closed 1 minute after the last reply. No new replies are allowed.