diff --git a/Action.c b/Action.c index 441c8f1c1..b1948cd63 100644 --- a/Action.c +++ b/Action.c @@ -697,7 +697,7 @@ static Htop_Reaction actionHelp(State* st) { addbartext(CRT_colors[MEMORY_COMPRESSED], "/", "compressed"); addbartext(CRT_colors[MEMORY_BUFFERS_TEXT], "/", "buffers"); addbartext(CRT_colors[MEMORY_CACHE], "/", "cache"); - addbartext(CRT_colors[BAR_SHADOW], " ", "used"); + addbartext(CRT_colors[BAR_SHADOW], " ", "claimed"); addbartext(CRT_colors[BAR_SHADOW], "/", "total"); addattrstr(CRT_colors[BAR_BORDER], "]"); diff --git a/MemoryMeter.c b/MemoryMeter.c index 4b0e9d0f1..b6df18a43 100644 --- a/MemoryMeter.c +++ b/MemoryMeter.c @@ -40,13 +40,16 @@ static void MemoryMeter_updateValues(Meter* this) { "MEMORY_METER_AVAILABLE is not the last item in MemoryMeterValues"); this->curItems = MEMORY_METER_AVAILABLE; - /* we actually want to show "used + compressed" */ - double used = this->values[MEMORY_METER_USED]; + /* we actually want to show "used + shared + compressed" */ + double claimed = this->values[MEMORY_METER_USED]; + if (!isnan(this->values[MEMORY_METER_SHARED])) { + claimed += this->values[MEMORY_METER_SHARED]; + } if (!isnan(this->values[MEMORY_METER_COMPRESSED])) { - used += this->values[MEMORY_METER_COMPRESSED]; + claimed += this->values[MEMORY_METER_COMPRESSED]; } - written = Meter_humanUnit(buffer, used, size); + written = Meter_humanUnit(buffer, claimed, size); METER_BUFFER_CHECK(buffer, size, written); METER_BUFFER_APPEND_CHR(buffer, size, '/');