Use TotalInactiveFile in GetContainerMemUsed (#10800)

Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
This commit is contained in:
bigsheeper 2021-10-28 16:40:25 +08:00 committed by GitHub
parent 1f2f76789e
commit d264e150cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -58,7 +58,7 @@ func GetContainerMemUsed() (uint64, error) {
return 0, errors.New("cannot find memory usage info from cGroups")
}
// ref: <https://github.com/docker/cli/blob/e57b5f78de635e6e2b688686d10b830c4747c4dc/cli/command/container/stats_helpers.go#L239>
inactiveFile := stats.Memory.InactiveFile
inactiveFile := stats.Memory.TotalInactiveFile
usage := stats.Memory.Usage.Usage
if inactiveFile < usage {
return usage - inactiveFile, nil