diff --git a/MemoryMeter.c b/MemoryMeter.c index 24dac98b8..36401cb79 100644 --- a/MemoryMeter.c +++ b/MemoryMeter.c @@ -40,9 +40,9 @@ static void MemoryMeter_updateValues(Meter* this) { this->values[MEMORY_METER_COMPRESSED] = NAN; this->values[MEMORY_METER_AVAILABLE] = NAN; Platform_setMemoryValues(this); - if (this->mode == GRAPH_METERMODE && !settings->showCachedMemory) { - this->values[MEMORY_METER_BUFFERS] = NAN; - this->values[MEMORY_METER_CACHE] = NAN; + if ((this->mode == GRAPH_METERMODE || this->mode == BAR_METERMODE) && !settings->showCachedMemory) { + this->values[MEMORY_METER_BUFFERS] = 0; + this->values[MEMORY_METER_CACHE] = 0; } /* Do not print available memory in bar mode */ static_assert(MEMORY_METER_AVAILABLE + 1 == MEMORY_METER_ITEMCOUNT, diff --git a/Settings.c b/Settings.c index 05950d0ab..fa473d1a1 100644 --- a/Settings.c +++ b/Settings.c @@ -699,6 +699,7 @@ int Settings_write(const Settings* this, bool onCrash) { printSettingInteger("show_cpu_temperature", this->showCPUTemperature); printSettingInteger("degree_fahrenheit", this->degreeFahrenheit); #endif + printSettingInteger("show_cached_memory", this->showCachedMemory); printSettingInteger("update_process_names", this->updateProcessNames); printSettingInteger("account_guest_in_cpu_meter", this->accountGuestInCPUMeter); printSettingInteger("color_scheme", this->colorScheme);