Why does the system report 7.7Gb of total Ram when I installed 8Gb? I'm using 14.04 on a Dell Vostro 2011
Ubuntu – Why does the system report 7.7Gb of total Ram when I installed 8Gb
14.04ramsystem-info
Related Solutions
This is because Windows and Linux have different understandings of how many bytes there are in one kilobyte, as this article explains.
For example
In Windows
Windows assumes that there are 1024 Bytes in a Kilobyte unit, and 1024 Kilobytes in a Megabyte unit etc.
In Ubuntu (GNU/Linux) …
Ubuntu assumes, a 1000 bytes constitute a Kilobyte (KB) unit, 1000 Kilobytes for a Megabyte (MB) and so on.
This ‘confusion’ came into existence in the old days, due to various computer storage hardware devices, such as ‘RAM’ and ‘ROM’ using 1024 as the ‘unit prefix’ (for technical reasons) when converting between units (except for ‘bytes’).
But most other storage devices such as HDDs and Flash drives, using 1000 as the base ‘unit prefix’, while calculating the sizes. So there arose a bit of a confusion among the experts, which to use while displaying file sizes in different units.
For a better explanation, read the Wikipedia entry on binary prefix
The computer industry currently uses terms such as kilobyte, megabyte, and gigabyte, and corresponding symbols KB, MB, and GB, in two different ways. In citations of main memory or RAM capacity, gigabyte customarily means 1073741824 bytes. This is a power of 1024 (specifically 10243), and 1024 is a power of 2 (specifically 210), therefore this usage is referred to as a binary prefix.
In most other contexts, the industry uses kilo, mega, giga, etc., in a manner consistent with their meaning in the International System of Units (SI): as powers of 1000. For example, a 500 gigabyte hard drive holds 500000000000 bytes, and a 100 megabit per second Ethernet connection transfers data at 100000000 bit/s. In contrast with “binary prefix”, this usage is referred to as a “decimal prefix“, as 1000 is a power of 10. So later, to avoid confusions, the IEC and NIST standardized them, and changed the symbols...
In usage, products and concepts typically described using powers of 1024 would continue to be, but with the new IEC prefixes. For example, a memory module of 536870912 bytes (512×1048576) would be referred to as 512 MiB or 512 mebibytes instead of 512 MB or 512 megabytes. Conversely, since hard drives have historically been marketed using the SI convention that “giga” means 1000000000, a “500 GB” hard drive would still be labelled as such.
According to these recommendations, operating systems and other software would also use binary and SI prefixes in the same way, so the purchaser of a “500 GB” hard drive would find the operating system reporting either “500 GB” or “466 GiB“, while 536870912 bytes of RAM would be displayed as “512 MiB”.
In simple terms, if an operating system uses the term ‘megabyte’ (MB), then it should use the 1000 bytes per kilobyte (KB), 1000 kilobytes to a megabyte (‘MB‘) etc perceptual value (‘decimal prefix), while converting between the units.
If it uses the value 1024 (‘binary prefix’), then it should address them as ‘kibibytes’ (KiB), ‘mebibytes (MiB) etc.
So in that sense, it does not matter whether the OS uses the ‘binary prefix’ or the ‘decimal prefix’, what’s important is that it uses the correct symbols to display them.
It is apparent that Windows is using the ‘binary prefix’, as if you take the first image, then you will see that it lists the size as ‘710,934,528 bytes’. Now take a calculator and divide it by ‘1024’, which should give you its size in ‘kibibytes’. Then re-divide it again and it will give you the value 678, which is in ‘mebibytes (MiB).
Now do the same, using the second image that was taken in Ubuntu. But this time, use the value 1000 instead of 1024, and you will get the output in megabytes (MB), 710.9.
I honestly do not know about ‘IEC’ and ‘NIST’ laws and how they are applied, but Windows, since it uses the ‘binary prefix’, should be using symbols KiB, MiB, GiB etc rather than using KB, MB, GB etc, and therefore seems like in a direct violation as well (the paper only says ‘would’ though).
Short Answer
It's probably just the kernel using memory. Instead of reporting kernel memory usage, Ubuntu instead subtracts form the total available. This is simply to let you know that the kernel memory cannot be freed in most cases. That memory is being used for things that are absolutely necessary, and so it will never be available.
Diagnostic Commands
I don't expect you to run all of these, but I've included them here for reference and completeness. Most relevant are commands 3 and 4. Also please note that all sizes are going to be in base 2 (e.g. GiB
) and not in base 10 (e.g. GB
) despite what the unit abbreviations might be.
You can check how big your RAM sticks are claiming to be with:
sudo dmidecode | grep Size | grep MB
You can check how much RAM is available for general use with (look for
Mem
andtotal
):free -h
You can estimate how much memory the kernel is using with:
cat /proc/meminfo | grep Slab
You can check for "stolen" graphics card memory with:
dmesg | grep stolen
You can look for specific hardware reserved memory by looking through:
dmesg | grep e820
You can test to make certain all of your memory works by running memtest
Explanation
The most likely explanation is simply that the extra space is being used by either your graphics card or the kernel itself. If you're not familiar, the kernel is the lowest-level part of the operating system, and any memory that it's using will not be available to you and so is not reported as free. The memory might be used for any number of reasons, such as the virtual memory tables, memory-mapped I/O, kernel processes, certain caches, shared graphics memory, etc.
Example: Looking at My Laptop
It is very likely that adding the output of command 3 to your 15.3GiB
will result in almost exactly 16GiB
. This was the case in my system:
- Installed RAM:
6GiB
- Reported in System Settings > Details:
5.6GiB
- Output of
cat /proc/meminfo | grep Slab
:316652 kB
- Converted to
GiB
:316652/2^20 = 0.3GiB
- Output of
dmesg | grep stolen
:32768K
- Converted to
GiB
:32768/2^20 = 0.03GiB
- Adding them together:
5.6 + 0.3 + 0.03 = 5.93GiB
Since the Slab
memory is not comprehensive, we can assume that the kernel is using the remaining 0.07GiB
in places we can't see, and so this is a very satisfying result.
Best Answer
The BIOS will reserve some memory, as will the most primitive level of the kernel, including some for video, perhaps. What is reported to you via system-info (which I don't use) or
free -m
is what is left.If you observe the entries in the
/var/log/kern.log
file from during boot, you will see many having to do with reserving memory and such, and finally, a summary line: