Skip to content

Commit

Permalink
7
Browse files Browse the repository at this point in the history
  • Loading branch information
xinyiZzz committed Aug 13, 2024
1 parent 41a85d4 commit 01551e8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions be/src/common/cgroup_memory_ctl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ struct CgroupsV2Reader : CGroupMemoryCtl::ICgroupsReader {
std::unordered_map<std::string, int64_t> metrics_map;
CGroupUtil::read_int_metric_from_cgroup_file((_mount_file_dir / "memory.stat"),
metrics_map);
*value -= metrics_map["inactive_file"];
if (*value < 0) {
if (*value < metrics_map["inactive_file"]) {
return Status::CgroupError("CgroupsV2Reader read_memory_usage negative memory usage");
}
*value -= metrics_map["inactive_file"];
return Status::OK();
}

Expand Down

0 comments on commit 01551e8

Please sign in to comment.