Idle Memory Usage as Performance Benchmark

In recent discussions it was often suggested that idle RAM usage was a proper way to measure a system’s suitability for older machines and as a benchmark for its responsiveness.

With “idle RAM usage” we mean the amount of memory consumed by the operating system itself and the preloaded applications like the window manager or the desktop environment. Higher idle RAM usage means that there is less memory available for application programs…

Running the commands free -h or htop before starting any other application programs can give you some insight about this.

On systems with very limited resources, like single board computers (SBCs) or very old hardware with, say, less than 2 GByte of RAM, this is a valid consideration. For such kind of use cases, you would probably don’t want to use desktop environments like Gnome or KDE and try to minimize the amount of little helper applications in the background.

However, we should consider that many application programs, namely browsers, graphics editors and video renderers can easily consume several times the memory of the bare operating system. Clever choice of applications, settings and tasks will do far more for the system’s overall responsiveness than the amount of memory used by the operating system.

When resources are not stretched to the limit, the amount of idle memory becomes irrelevant for a system’s performance, even the contrary might be true:

  • Preloading often used applications into the memory reduces their startup times, on the expense of idle RAM. preload is an optional feature of the Linux kernel.
  • Storing applications’ temporary data in a dedicated RAM area and not on the disk makes applications more responsive at the expense of unused memory and CPU.
  • Active monitoring of running processes and re-prioritizing them (tech babble: “automatic renicing”) costs a bit of memory and CPU time but does often prevent applications from becoming unresponsive.

and, and, and.

In all these cases, higher idle memory and CPU usage is the price paid for better responsiveness - as long as we don’t reach their limits.

When we discuss the virtues of different distributions or setups, there is never a unique answer to the question, whether a specific optimization makes sense: It always depends on the environment and the use case.

It should also be said that installing more memory, switching HDDs for SSDs and installing dedicated graphics cards have probably far higher impact on the user experience than any optimization, be it towards reducing the OS’s memory load in favour of applications or towards increasing it in favour of quicker access.

That’s the reason why most distributions’ developers try to keep a balance between austerity and optimization. The big all-purpose distributions aim to provide solutions that will work reasonably well on practically all platforms whilst still providing enough features to make your work pleasant and easy, whilst others cater for more specific use cases.

3 Likes

All this is absolutely correct.

I want to abstract the basic idea of this even further:

It is never a good idea to judge thing A by only a single piece of its set of properties.

Example

Imagine, you bought a car. You think its mix of how it looks, performance during speeding up from 0 to 100 km/h, handling in left/right turns and its brake ability is a good fit for what you were looking for.

Now, imagine someone comes to you and tells you “your car is shit, it takes 3.3 seconds for it to reach 100 km/h speed, when starting from 0”. You would think, “wait, but the handling is pretty good, the braking is also fine, so I sacrifice these 0.4 seconds of speed increase for these 2 other performance properties”. Still, the other person again tells you “no, it’s shit, it takes 3.3 seconds to reach 100 km/h. My car takes 2.9 seconds to reach that.”. Perhaps that may be true, but looking at the other properties, this car has worse handling and far worse braking.
Therefore, neither car is “better” or “worse”; it depends on what you are looking for, what actually matters to you. After all, you are the one paying thousands of dollars for that car. It has to fit you, not some measurement, that almost says nothing about that car.

I think it is now clear to every human with at least average thinking capabilities, that judging – whatever it is – just by 1 single thing does not say anything about that thing.

It does not matter, if you are judging a car, a movie, a person, an animal, a painting or, in this case, an operating system. Everything that is not one-dimensional has always several properties it should be judged by. It would be absolutely stupid and narrow minded to judge it by only 1 single property.

Now, more to the topic and less abstract:

Taking more RAM is smart, if that RAM is available.
What is the point of owning a car, if you do not have a driver’s license?
What is the point of owning a hunting rifle, without having a hunter’s license?
What is the point of owning a painting, if you just store it in your basement, instead of showing it off in your room?
What is the point of buying a pizza, if you will let it go bad, so you wouldn’t ever eat it?
What is the point of having X GB RAM, if you only use half or a third of it?

If you have something, use it. If you do not use that thing, it is absolutely useless to you. You need to use it for it to fulfill its purpose.
Therefore, if you have 8GB RAM and you never go beyond 2GB RAM usage, then 6GB RAM (which can be expensive, especially when looking at laptop RAM) is totally wasted; you pretty much wasted your money on something you don’t even use.

So, it’s just a very smart move for software developers to use all resources available, if possible. This can improve responsiveness and the overall user experience of that software.
The only time you should worry about minimizing RAM usage is when you are running software on micro controllers or single board computers (though, even SBCs are becoming more lenient in this regard, especially so since the 8GB version of the newest Raspberry Pi 4 Model B was released).

1 Like