48

While viewing the reports of htop, I would like to know what the orange/brown 'cached memory' bars actually indicate. Really I'm looking for a more practical explanation of what I'm looking at, rather that pure CS terms. Though I'd like to have both.

When I see a large amount of memory being (having already been?) cached, will that have any effect on system performance? What would normally cause the cached memory to increase so much while the used memory (green) stays pretty low?

Here is a screen capture of an example htop report. enter image description here

1 Answer 1

65

cached memory is used so that the HDD doesn't have to be read each time you open a file or a folder. So when you cache something it saves a disk read, that saves time and that's why Ubuntu caches as much as possible.

Having free memory isn't really good since it's not used, having cached memory will make access times shorter and improves performance. so the cached memory can be viewed as free memory since it's not actually used by any program it's just there to be as a backup of what could be used.

Cached memory + free memory is the same as the available memory, since the cached memory will be cleared if a program needs the space. So having lots of RAM will increase the performance of Ubuntu in general, especially if you are using programs with heavy RAM usage.

3
  • Did you mean "disk heavy programs?"
    – Clément
    Apr 27, 2016 at 22:10
  • 4
    I think it should be "So having lots of RAM will increase performance of Ubuntu in general if you are using RAM or Disk-Read heavy programs."
    – TafT
    Oct 6, 2016 at 14:18
  • So can we safely say that when we observe lots of cache memory usage in htop result, it means the system is temporarily storing disk-read output for us? Is there other source of information that will be saved in cache memory other than disk-read output?
    – Sta_Doc
    Mar 10, 2022 at 4:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .