diff --git a/threadfunc/thread_func.cpp b/threadfunc/thread_func.cpp index 7b8a683..fc83806 100644 --- a/threadfunc/thread_func.cpp +++ b/threadfunc/thread_func.cpp @@ -348,9 +348,9 @@ bool InsufficientFreeMemory() { char name1[20]; std::string strMemFree = GetFileContent("/proc/meminfo", 2); sscanf(strMemFree.c_str(), "%s%ld", name1, &mem_free); - mem_free = mem_free / 1024; - zlog_warn(zct, "free memory: %ld MB", mem_free); + mem_free = mem_free / 1024; if (mem_free < 80) { + zlog_warn(zct, "free memory: %ld MB", mem_free); return true; } else { return false;