-
Notifications
You must be signed in to change notification settings - Fork 5.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Potential memory leak on TiDB server #32289
Comments
The memory usage is consumed by the internal background worker. |
@zeminzhou what's your tidb_version and analyze_version? |
tidb_version is 5.2.2, how can I get the Is that a dangling analyze? |
show global variables like "%tidb_analyze_version%"; |
We enhanced the memory usage of analyze in v5.3 (with tidb_analyze_version=2 which is the default set). Please try with it, if you have to stick to v5.2.2, please set @@tidb_analyze_version=1 referring to this KB https://kb.pingcap.com/post/solutions/405 as a workaround. |
Could you kindly educate me on how the |
Are you meaning this is a fixed memory cost for TiDB servers because it's a long-lived background worker? That doesn't explain why the other TiDB servers on the cluster don't have this part of memory footprints. |
@coderplay the major memory cost is from analyze job, which is a scheduled background process, instead of long-living. Background analyze job is scheduled mainly based on 1. the ratio of modification on this table 2. if current time is within the window set. For tidb-version < v5.1.0, the default analyze-version is 1. |
Yes, you are right. I missed it. If you see memory usage always high, it could be the memory leak issue. If the memory usage is sometimes high but sometimes drops, it could be the limitation of the old sampling algorithm. Background auto-analyze jobs can be running but not shown in the results of You can upgrade to v5.3 to get stable analyze v2 or just workaround to use analyze v1. |
Thanks for the confirmation. Since it's fixed, I will go ahead and close this issue. |
Duplicated by #32499 |
Bug Report
Please answer these questions before submitting your issue. Thanks!
I don't know how to reproduce it. We notice there is one TiDB server in our cluster with 7.9 GB memory usage, the rest TiDB servers are empty, and we haven't run queries on that cluster for quite a while. The
show processlist
returns nothing except the session we run this show command.Here is the heap dump (click the image):
Any clues on that?
The text was updated successfully, but these errors were encountered: