The "available memory" of the TiKV server suddenly increased from 6G to 200G. Does TiKV clean up memory by itself?

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: TiKV服务器的【可用内存】从6G突然增加到200G。 是TiKV自己会清理内存么?

| username: 超7成网友

[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

| username: tidb狂热爱好者 | Original post link

After TiKV’s memory usage increases, it will continue to occupy that much memory without any changes. Unless you restart TiKV.

| username: ddhe9527 | Original post link

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.

| username: 超7成网友 | Original post link

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?

| username: ddhe9527 | Original post link

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.

| username: Raymond | Original post link

Go check if TiKV suddenly ran out of memory. The method to check is:

  1. Execute the command dmesg -T | grep 'tikv-server' on the corresponding TiKV node to see if there is any output information.
| username: system | Original post link

This topic was automatically closed 1 minute after the last reply. No new replies are allowed.