modify log info.

This commit is contained in:
pandx 2024-11-05 15:50:22 +08:00
parent fc5e135c14
commit a531859d09

View File

@ -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;