5

PROBLEM

My memory is full but the processes list is empty of heavy programs!


Usage:

Total memory is 4GB but only 400MB is free:

see usage Screen Shot


Monitor with htop:

When sorting by %MEM -> heavy programs only use 1% of memory!

Which process filled my RAM?

see htop Screen Shot

2
  • 8
    See linuxatemyram.com
    – heemayl
    Mar 7, 2016 at 6:36
  • 1
    And please don't post screenshots of text. Just post the text here and apply code formatting. The boxes and arrows are not worth the illegible pictures.
    – muru
    Mar 14, 2016 at 6:07

1 Answer 1

1

My memory is full but processes list is empty of heavy program!

That's because the memory is filled with filesystem metadata (aka "buffers") and files' contents (aka "cached") cached by the kernel.

Since it's common for programs / users to access those kind of resources multiple times in a short timeframe and not using memory is a waste, the kernel caches them in order for them to be accessed faster than it would by reading them again from the disk.

The exact amount of cached data is reported on the 5th and 6th columns:

             total       used       free     shared    buffers     cached
Mem:          3838       2895        942        120        461        947
-/+ buffers/cache:       1487       2350
Swap:         4394        615       3779

Since the cached data can be dropped immediately if the memory is required for something else, the cached data isn't really taken and is actually available for programs to use it.

The "real" (net of buffers / cached data) used / free memory is reported in the third row ("-/+ buffers/cache:"):

             total       used       free     shared    buffers     cached
Mem:          3838       2895        942        120        461        947
-/+ buffers/cache:       1487       2350
Swap:         4394        615       3779

For easiness you could add a couple of aliases to print only the "real" used / free memory to ~/.bashrc:

alias real_used="free -m | awk 'NR==3{print $3}'"
alias realf_free="free -m | awk 'NR==3{print $4}'"
1
  • 1
    For me it's even swapping because of the full memory, so it can't be those buffers, right?
    – Tooniis
    Nov 22, 2018 at 4:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.