1

I have just installed Linux Mint about 5 days ago, and then I have upgraded my RAM memory from 8 GB to 12 GB, and I have 4 GB more on the way, so it will get to 16 GB or RAM. The only thing is, I don't understand how the free -g command works. Here's a picture of Stacer, in which I can see my RAM up to 12 GB: Stacer

But while I use the terminal free -g command, it shows me this:

dragos@madscientistlab ~ $ free -g
              total        used        free      shared  buff/cache   available
Mem:             11           3           6           0           2           7
Swap:             7           0           7

It has only 9 GB of RAM if we add the USED RAM and FREE RAM, and it has only 11 GB available in the total column, out of 12. Is it something wrong with my RAM memory? Or is it something that I'm not understanding?

Also, one more question: If I have 12 GB of RAM, why does Stacer say I only have 11.6 GB?

Stephen Kitt
  • 434,908
  • You also have 2GB in buffers/cache. This is the memory used for the page cache and kernel buffers – Raman Sailopal Dec 21 '17 at 14:24
  • Thanks for your reply @RamanSailopal, so everything is alright for me? I bought this new RAM as DDR3L, and don't know what my other onboard RAM type is, DDR3 or DDR3L, and I thought that maybe they don't work that well. – unkn0wnx Dec 21 '17 at 14:25
  • free -m gives you a better picture since the -g option don't give you decimals. – baselab Dec 21 '17 at 14:26
  • Some great information in this question / answer - https://unix.stackexchange.com/questions/34795/correctly-determining-memory-usage-in-linux – EightBitTony Dec 21 '17 at 14:32

1 Answers1

2

Your system is fine.

You need to add “available” and “used” memory, rather than “free” and “used” memory. You also need to take truncation into account: you have somewhere over 3GiB of memory used (by programs), somewhere over 6GiB of memory completely unused, somewhere over 2GiB of memory used in buffers and caches, and altogether, somewhere over 7GiB of memory available. Somewhere over 3, plus somewhere over 7, ends up giving a total somewhere over 10, or even 11 in your case. You should use free -m to get a better picture.

You’ll find out more about available memory in How can I get the amount of available memory portably across distributions?

Regarding your 11.6GiB v. 12GiB, you “lose” some memory because it’s set aside for the system’s purposes: your firmware, integrated GPU, and the kernel all keep some memory for their own purposes, leaving 11.6GiB usable by programs.

Stephen Kitt
  • 434,908