New 16GB of RAM installed yet I see 15.3 on my system. Why?

Just switched 4GBs to 16GBs of RAM. However, when I look at how much memory I have, it says 15.3. I'm just wondering why did my memory drop down when I just installed 16 GBs of RAM.

system details screenshot


Solution 1:

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.

  1. You can check how big your RAM sticks are claiming to be with:

    sudo dmidecode | grep Size | grep MB
    
  2. You can check how much RAM is available for general use with (look for Mem and total):

    free -h
    
  3. You can estimate how much memory the kernel is using with:

    cat /proc/meminfo | grep Slab
    
  4. You can check for "stolen" graphics card memory with:

    dmesg | grep stolen
    
  5. You can look for specific hardware reserved memory by looking through:

    dmesg | grep e820
    
  6. 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.

See Also

  • How much RAM does the kernel use? (Unix & Linux)
  • Reducing reserved RAM (Arch forums)
  • Why is some RAM marked as hardware reserved in Windows 7? (Superuser)
  • Why does my system show 3.2GiB of RAM? (Unix & Linux)
  • Ubuntu units policy (Ubuntu wiki)