17

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

Byte Commander
  • 107,489
zshanabek
  • 355

3 Answers3

34

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.

  • 4
    This does make sense, since OP's graphics is Intel, which always takes part of RAM for VRAM. – Ruslan Jun 08 '17 at 13:08
  • 1
    Bonus: you can tweak the amount allocated to the GFX in BIOS. – Agent_L Jun 08 '17 at 14:12
  • 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, – Alamjit Singh Jun 08 '17 at 14:35
  • While it explains the most probable cause, this answer isn't yet backup up by a link/reference providing more detail/proof. – mbx Jun 09 '17 at 11:06
  • 2
    What if I have my integrated graphics disabled, VRAM set to the lowest setting (32 MiB), but I'm still missing 0.6 GiB? – Aaron Franke Feb 28 '20 at 07:17
  • @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. – Dmitry Grigoryev Feb 28 '20 at 09:25
  • The kernel would occupy a lot more than a few megabytes. As per https://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. – sayap Sep 08 '20 at 08:00
  • Same issue here but my system has a dedicated graphics card (nVidia GeForce GT 430) with 510mb build in memory. – dileepa May 17 '21 at 08:39
9

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.

sempaiscuba
  • 1,433
  • 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. – Ruslan Jun 08 '17 at 14:22
  • @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. – sempaiscuba Jun 08 '17 at 14:43
  • grep SReclaimable /proc/meminfo says almost the same (a bit less than) Slab. Not sure how to interpret this. – Ruslan Jun 08 '17 at 14:54
  • A bit late but "missing" RAM may come from the CPU! httpss://unix.stackexchange.com/questions/562720/system-monitor-in-ubuntu-18-shows-only-5-8-gb-ram-out-of-8-gb-installed – Robin_ Jan 14 '21 at 04:53
-5

Your actual RAM is measured in 8 Gigabytes = 8,000,000,000 bytes

that is, 8,000,000,000/(1024*1024)=7629.39 MeBi Bytes=7.62939 GiBi Bytes

Since it is rounded up, it is shown as 7.7 GiBi Bytes.

terdon
  • 100,812
  • 1
    Comments are not for extended discussion; this conversation has been moved to chat. – terdon Jun 08 '17 at 17:04
  • 5
    @terdon Deleting comments that correctly point out an answer is wrong? WTF – CodesInChaos Jun 08 '17 at 17:17
  • 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. – XavierStuvw Jun 08 '17 at 18:09
  • 4
    This answer is wrong; memory module sizes are measured in base-1024, so the OP has 8GiB physical RAM, not 8GB. – marcelm Jun 08 '17 at 18:30
  • 8
    @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. – terdon Jun 08 '17 at 18:32
  • 2
    @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. – mbx Jun 09 '17 at 11:01
  • 3
    @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. – terdon Jun 09 '17 at 11:11