diff --git a/conf/nebula-graphd.conf.default b/conf/nebula-graphd.conf.default index fa406f8008a..43792df94c3 100644 --- a/conf/nebula-graphd.conf.default +++ b/conf/nebula-graphd.conf.default @@ -79,7 +79,7 @@ --auth_type=password ########## memory ########## -# System memory high watermark ratio +# System memory high watermark ratio, cancel the memory checking when the ratio greater than 1.0 --system_memory_high_watermark_ratio=0.8 ########## experimental feature ########## diff --git a/conf/nebula-graphd.conf.production b/conf/nebula-graphd.conf.production index 26bc28827cf..09f26e5169e 100644 --- a/conf/nebula-graphd.conf.production +++ b/conf/nebula-graphd.conf.production @@ -77,7 +77,7 @@ --auth_type=password ########## memory ########## -# System memory high watermark ratio +# System memory high watermark ratio, cancel the memory checking when the ratio greater than 1.0 --system_memory_high_watermark_ratio=0.8 ########## experimental feature ########## diff --git a/src/common/memory/MemoryUtils.cpp b/src/common/memory/MemoryUtils.cpp index 442e7a87597..43477149eff 100644 --- a/src/common/memory/MemoryUtils.cpp +++ b/src/common/memory/MemoryUtils.cpp @@ -27,6 +27,9 @@ static const std::regex reTotalCache(R"(^total_(cache|inactive_file)\s+(\d+)$)") std::atomic_bool MemoryUtils::kHitMemoryHighWatermark{false}; StatusOr MemoryUtils::hitsHighWatermark() { + if (FLAGS_system_memory_high_watermark_ratio >= 1.0) { + return false; + } double available = 0.0, total = 0.0; if (FLAGS_containerized) { FileUtils::FileLineIterator iter("/sys/fs/cgroup/memory/memory.stat", &reTotalCache);