From 1ac6729ef1142c79a98238d24ec98cba12188620 Mon Sep 17 00:00:00 2001 From: Gautier DI FOLCO Date: Tue, 7 Dec 2021 23:19:49 +0100 Subject: [PATCH] Less sensitive memory default thresholds --- common/memory.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/common/memory.cc b/common/memory.cc index 423e6b2..6e09f84 100644 --- a/common/memory.cc +++ b/common/memory.cc @@ -84,9 +84,12 @@ std::string mem_string( const MemoryStatus & mem_status, break; } default: // Default mode, just show the used/total memory in MB - if(mem_status.used_mem>100000 && mem_status.total_mem>100000) oss<(mem_status.used_mem/1024)<<"/"<(mem_status.total_mem/1024)<<"GB"; - else if(mem_status.used_mem<100000 && mem_status.total_mem>100000) oss<(mem_status.used_mem)<<"MB/"<(mem_status.total_mem/1024)<<"GB"; - else oss<(mem_status.used_mem)<<"/"<(mem_status.total_mem)<<"MB"; + if(mem_status.used_mem>10000 && mem_status.total_mem>10000) + oss<(mem_status.used_mem/1024)<<"/"<(mem_status.total_mem/1024)<<"GB"; + else if(mem_status.used_mem<10000 && mem_status.total_mem>10000) + oss<(mem_status.used_mem)<<"MB/"<(mem_status.total_mem/1024)<<"GB"; + else + oss<(mem_status.used_mem)<<"/"<(mem_status.total_mem)<<"MB"; } if( use_colors )