From ecb93627237b5b8a13e8a8a42afac0d0457f2e76 Mon Sep 17 00:00:00 2001 From: Xinyi Zou Date: Tue, 13 Aug 2024 22:47:25 +0800 Subject: [PATCH] 9 --- be/src/util/mem_info.cpp | 2 +- be/test/util/cgroup_util_test.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/be/src/util/mem_info.cpp b/be/src/util/mem_info.cpp index 07ee16d1d4f9fb..8be1db5cb8559c 100644 --- a/be/src/util/mem_info.cpp +++ b/be/src/util/mem_info.cpp @@ -280,7 +280,7 @@ void MemInfo::refresh_proc_meminfo() { if (mem_available < 0) { mem_available = _s_cgroup_mem_limit - _s_cgroup_mem_usage; } else { - mem_available = std::min(mem_available, (_s_cgroup_mem_limit - _s_cgroup_mem_usage)); + mem_available = std::min(mem_available, _s_cgroup_mem_limit - _s_cgroup_mem_usage); } } if (mem_available < 0) { diff --git a/be/test/util/cgroup_util_test.cpp b/be/test/util/cgroup_util_test.cpp index f4fd58c1f3497a..92102120327840 100644 --- a/be/test/util/cgroup_util_test.cpp +++ b/be/test/util/cgroup_util_test.cpp @@ -68,8 +68,8 @@ TEST_F(CGroupUtilTest, ReadMetrics) { TEST_F(CGroupUtilTest, memlimit) { LOG(INFO) << CGroupMemoryCtl::debug_string(); - uint64_t mem_limit; - uint64_t mem_usage; + int64_t mem_limit; + int64_t mem_usage; auto status1 = CGroupMemoryCtl::find_cgroup_mem_limit(&mem_limit); auto status2 = CGroupMemoryCtl::find_cgroup_mem_usage(&mem_usage); if (CGroupUtil::cgroupsv1_enable() || CGroupUtil::cgroupsv2_enable()) {