-
【TiDB 版本】:
v5.0.1 -
【问题描述】:
TiDB 内存 heap 占用高,请教状态是否正常。
(tidb-server启动后,heap in_use就直接变成4.xG, 如果有大量更新/插入之后,很容易触发10G的报警)
搜了asktug的帖子看到别人好像都是MB级别的状态~ -
内存监控图
-
服务器执行了pprof后
top内容如下:
(pprof) top
Showing nodes accounting for 4.45GB, 97.84% of 4.55GB total
Dropped 209 nodes (cum <= 0.02GB)
Showing top 10 nodes out of 53
flat flat% sum% cum cum%
3.23GB 70.99% 70.99% 3.23GB 70.99% github.com/pingcap/tidb/statistics.FMSketchFromProto
0.52GB 11.52% 82.51% 0.52GB 11.52% github.com/pingcap/tidb/store/copr.(*copIteratorWorker).handleCopResponse
0.36GB 8.01% 90.52% 0.36GB 8.01% github.com/pingcap/tidb/statistics.NewCMSketch
0.06GB 1.43% 91.95% 0.06GB 1.43% reflect.New
0.06GB 1.40% 93.35% 0.14GB 3.15% github.com/pingcap/tidb/statistics.(*Histogram).AppendBucketWithNDV
0.06GB 1.35% 94.70% 0.48GB 10.50% github.com/pingcap/tidb/statistics/handle.(*Handle).initStatsHistograms4Chunk
0.04GB 0.96% 95.66% 0.04GB 0.96% github.com/pingcap/tidb/statistics.(*Histogram).PreCalculateScalar
0.04GB 0.93% 96.59% 0.08GB 1.72% github.com/pingcap/tidb/util/chunk.(*Column).AppendBytes
0.04GB 0.79% 97.38% 0.04GB 0.79% github.com/pingcap/tidb/util/chunk.(*Column).finishAppendVar
0.02GB 0.46% 97.84% 0.05GB 1.04% github.com/pingcap/tidb/util/chunk.New
- 原始文件
pprof: pprof.alloc_objects.alloc_space.inuse_objects.inuse_space.001.pb.gz (100.3 KB)
PNG: profile001 | 477x500