Why does Ubuntu show slightly less RAM than my computer has built in?

ram
9,915

Solution 1

This is most probably due to your graphics card reclaiming some of the RAM for its own purposes (mostly texture storage). There's also a chunk of memory reserved by the kernel, but it's tiny (a few megabytes) compared to the discrepancy you see.

On many systems, the amount of RAM reserved for graphics is configurable in BIOS settings.

Solution 2

It's probably because the kernel is using part of your memory. Since kernel memory can't be freed in most cases, Ubuntu just reports the total available (less the amount used by the kernel).

You can find out more detail by using the following commands:

Check how big your RAM sticks claim to be:

sudo dmidecode | grep Size | grep MB

Check how much RAM is available for general use:

free -h

Estimate how much memory your kernel is using:

cat /proc/meminfo | grep Slab

Check for memory "stolen" by your graphics card:

dmesg | grep stolen

This is actually covered in this answer (which has more details).

Hope that helps.

Share:
9,915

Related videos on Youtube

zshanabek
Author by

zshanabek

back-end developer, public speaker, linux enthusiast, lotr fan. Love simple solutions. I speak 6 languages

Updated on September 18, 2022

Comments

  • zshanabek
    zshanabek over 1 year

    My machine's RAM is 8 GB. I have recently installed Ubuntu 17.04.

    Why does Ubuntu show me that it has only 7.7 GB and not the full 8 GB?

    About this computer

    • sabna
      sabna almost 7 years
      What does cat /proc/meminfo tell you?
  • Iluvathar
    Iluvathar almost 7 years
    This does make sense, since OP's graphics is Intel, which always takes part of RAM for VRAM.
  • Agent_L
    Agent_L almost 7 years
    Bonus: you can tweak the amount allocated to the GFX in BIOS.
  • Iluvathar
    Iluvathar almost 7 years
    Slab is inconclusive. I have 16 GiB of RAM, with 15.37 GiB reported by free, and 2.34 GiB of Slab memory, which doesn't match the other figures.
  • Alamjit Singh
    Alamjit Singh almost 7 years
    In layman language, System reserves ram for graphics memory mapping, and for kernel. Apart from this ram size can be also reduced due to some bios settings, or ability of the motherboard to handle memory. So no one gets total size of ram after installing it in system. This answer is right. I also confirmed it from other sites,
  • sempaiscuba
    sempaiscuba almost 7 years
    @Ruslan Try running cat /proc/meminfo | grep SReclaimable to see if that explains the discrepancy. You could also check if you have any memory "stolen" by your graphics card (dmesg | grep stolen) If there is still a shortfall, try running dmesg | grep e820 which will help you to identify any other hardware reserved memory.
  • Iluvathar
    Iluvathar almost 7 years
    grep SReclaimable /proc/meminfo says almost the same (a bit less than) Slab. Not sure how to interpret this.
  • terdon
    terdon almost 7 years
    Comments are not for extended discussion; this conversation has been moved to chat.
  • CodesInChaos
    CodesInChaos almost 7 years
    @terdon Deleting comments that correctly point out an answer is wrong? WTF
  • XavierStuvw
    XavierStuvw almost 7 years
    To check whether the units of the RAM are decimal or binary (man units is a useful reference here), see sudo lshw | grep -A 6 memory | head. In my case the units are in GiB in both the command line and the gui report. So the argument that the difference is due to different units plus a rounding looks coincidental to me. Note though that the disk space is given in decimal units (GB), which adds to the confusion.
  • marcelm
    marcelm almost 7 years
    This answer is wrong; memory module sizes are measured in base-1024, so the OP has 8GiB physical RAM, not 8GB.
  • terdon
    terdon almost 7 years
    @CodesInChaos no, I deleted >20 comments because they were having a discussion and, more importantly, instead of explaining why this answer was wrong, they were just stating that it's wrong and in a rude way. If someone wants to point out errors in an answer, they should do so politely and constructively. "Why was this upvoted? It's complete nonsense" is neither.
  • sabna
    sabna almost 7 years
    @terdon usually when downvoting, people are suggested to leave a note why - Why was this upvoted? It's complete nonsense may not be the most polite way to do so but it certainly explains a downvote better than having no comment, but this would be a topic for meta.
  • sabna
    sabna almost 7 years
    While it explains the most probable cause, this answer isn't yet backup up by a link/reference providing more detail/proof.
  • terdon
    terdon almost 7 years
    @mbx no, it explains nothing but that one person for reasons they didn't explain considers it wrong. However, instead of being helpful and pointing out the issue, they chose to only point out their own perceived superiority. Compare that to the comments here now which at least take the time to explain what the issue is.
  • Aaron Franke
    Aaron Franke about 4 years
    What if I have my integrated graphics disabled, VRAM set to the lowest setting (32 MiB), but I'm still missing 0.6 GiB?
  • Dmitry Grigoryev
    Dmitry Grigoryev about 4 years
    @AaronFranke How much RAM did you get back by disabling the integrated graphics? Perhaps it still consumes RAM. Also, videoadapters are not the only users of RAM. On a system with a device tree you could probably account for every byte.
  • sayap
    sayap over 3 years
    The kernel would occupy a lot more than a few megabytes. As per linux-mm.org/WhereDidMyMemoryGo, on a 64-bit kernel, about 1.36% of total memory will be used by the kernel to maintain the mem_map[] data structure. So on a machine with 8GB of memory, that alone would take away more than 100MB already.
  • Robin_
    Robin_ over 3 years
    A bit late but "missing" RAM may come from the CPU! httpss://unix.stackexchange.com/questions/562720/system-moni‌​tor-in-ubuntu-18-sho‌​ws-only-5-8-gb-ram-o‌​ut-of-8-gb-installed
  • dileepa
    dileepa almost 3 years
    Same issue here but my system has a dedicated graphics card (nVidia GeForce GT 430) with 510mb build in memory.