Score:1

Not showing available RAM

th flag

I am currently running Ubuntu on my Laptop. According to my specs and looking at my bios there should be 16GiB of RAM. When I first got it there were 16GiB of RAM, but whenever I call free or htop right now, it only shows 12GiB. The output for free is:

              total        used        free      shared  buff/cache   available
Mem:       12077124     1817484     8333912       18500     1925728     9965952
Swap:      33554428           0    33554428

and the output for dmesg | grep -i memory is:

[    0.004350] check: Scanning 1 areas for low memory corruption
[    0.004667] ACPI: Reserving FACP table memory at [mem 0xc5993000-0xc5993113]
[    0.004668] ACPI: Reserving DSDT table memory at [mem 0xc597c000-0xc598d8ca]
[    0.004669] ACPI: Reserving FACS table memory at [mem 0xcbc19000-0xcbc1903f]
[    0.004669] ACPI: Reserving SSDT table memory at [mem 0xc7c9c000-0xc7c9c0a1]
[    0.004670] ACPI: Reserving SSDT table memory at [mem 0xc7c9a000-0xc7c9b18e]
[    0.004670] ACPI: Reserving SSDT table memory at [mem 0xc7c8c000-0xc7c93228]
[    0.004671] ACPI: Reserving IVRS table memory at [mem 0xc7c6a000-0xc7c6a1a3]
[    0.004671] ACPI: Reserving SSDT table memory at [mem 0xc7c38000-0xc7c38a41]
[    0.004672] ACPI: Reserving SSDT table memory at [mem 0xc7bb3000-0xc7bb3631]
[    0.004672] ACPI: Reserving TPM2 table memory at [mem 0xc7bb2000-0xc7bb2033]
[    0.004673] ACPI: Reserving POAT table memory at [mem 0xc7baf000-0xc7baf054]
[    0.004673] ACPI: Reserving BATB table memory at [mem 0xc7b9a000-0xc7b9a049]
[    0.004674] ACPI: Reserving HPET table memory at [mem 0xc5992000-0xc5992037]
[    0.004675] ACPI: Reserving APIC table memory at [mem 0xc5991000-0xc5991137]
[    0.004675] ACPI: Reserving MCFG table memory at [mem 0xc5990000-0xc599003b]
[    0.004676] ACPI: Reserving SBST table memory at [mem 0xc598f000-0xc598f02f]
[    0.004676] ACPI: Reserving WSMT table memory at [mem 0xc598e000-0xc598e027]
[    0.004677] ACPI: Reserving VFCT table memory at [mem 0xc596e000-0xc597b883]
[    0.004677] ACPI: Reserving SSDT table memory at [mem 0xc5968000-0xc596d353]
[    0.004678] ACPI: Reserving CRAT table memory at [mem 0xc5967000-0xc5967ebf]
[    0.004679] ACPI: Reserving CDIT table memory at [mem 0xc5966000-0xc5966028]
[    0.004679] ACPI: Reserving FPDT table memory at [mem 0xc7b9b000-0xc7b9b033]
[    0.004680] ACPI: Reserving SSDT table memory at [mem 0xc5965000-0xc5965148]
[    0.004680] ACPI: Reserving SSDT table memory at [mem 0xc5963000-0xc59644ba]
[    0.004681] ACPI: Reserving SSDT table memory at [mem 0xc5961000-0xc596257f]
[    0.004681] ACPI: Reserving SSDT table memory at [mem 0xc595d000-0xc5960972]
[    0.004682] ACPI: Reserving BGRT table memory at [mem 0xc595c000-0xc595c037]
[    0.004683] ACPI: Reserving SSDT table memory at [mem 0xc595b000-0xc595b057]
[    0.004683] ACPI: Reserving SSDT table memory at [mem 0xc595a000-0xc595a24c]
[    0.004684] ACPI: Reserving SSDT table memory at [mem 0xc5958000-0xc59592bb]
[    0.004684] ACPI: Reserving SSDT table memory at [mem 0xc5957000-0xc5957ad4]
[    0.004685] ACPI: Reserving UEFI table memory at [mem 0xcbc18000-0xcbc180d9]
[    0.004685] ACPI: Reserving SSDT table memory at [mem 0xc5956000-0xc5956051]
[    0.004686] ACPI: Reserving SSDT table memory at [mem 0xc7c98000-0xc7c9808f]
[    0.004687] ACPI: Reserving SSDT table memory at [mem 0xc7c97000-0xc7c979b4]
[    0.004947] Early memory node ranges
[    0.032537] PM: hibernation: Registered nosave memory: [mem 0x00000000-0x00000fff]
[    0.032539] PM: hibernation: Registered nosave memory: [mem 0x0009f000-0x0009ffff]
[    0.032539] PM: hibernation: Registered nosave memory: [mem 0x000a0000-0x000dffff]
[    0.032540] PM: hibernation: Registered nosave memory: [mem 0x000e0000-0x000fffff]
[    0.032541] PM: hibernation: Registered nosave memory: [mem 0x09c00000-0x09da0fff]
[    0.032542] PM: hibernation: Registered nosave memory: [mem 0x09f00000-0x09f0cfff]
[    0.032542] PM: hibernation: Registered nosave memory: [mem 0x9973c000-0x9973cfff]
[    0.032543] PM: hibernation: Registered nosave memory: [mem 0x99749000-0x99749fff]
[    0.032544] PM: hibernation: Registered nosave memory: [mem 0xc0a5b000-0xc0aebfff]
[    0.032545] PM: hibernation: Registered nosave memory: [mem 0xc1214000-0xc1214fff]
[    0.032546] PM: hibernation: Registered nosave memory: [mem 0xc1bee000-0xc1beefff]
[    0.032547] PM: hibernation: Registered nosave memory: [mem 0xc4b7e000-0xcad7dfff]
[    0.032548] PM: hibernation: Registered nosave memory: [mem 0xcad7e000-0xcbd7dfff]
[    0.032548] PM: hibernation: Registered nosave memory: [mem 0xcbd7e000-0xcbdfdfff]
[    0.032549] PM: hibernation: Registered nosave memory: [mem 0xce000000-0xcfffffff]
[    0.032549] PM: hibernation: Registered nosave memory: [mem 0xd0000000-0xf7ffffff]
[    0.032550] PM: hibernation: Registered nosave memory: [mem 0xf8000000-0xfbffffff]
[    0.032550] PM: hibernation: Registered nosave memory: [mem 0xfc000000-0xfdbfffff]
[    0.032551] PM: hibernation: Registered nosave memory: [mem 0xfdc00000-0xfdcfffff]
[    0.032551] PM: hibernation: Registered nosave memory: [mem 0xfdd00000-0xfed7ffff]
[    0.032551] PM: hibernation: Registered nosave memory: [mem 0xfed80000-0xfed80fff]
[    0.032552] PM: hibernation: Registered nosave memory: [mem 0xfed81000-0xffffffff]
[    0.071132] Memory: 11923324K/12401088K available (14345K kernel code, 3478K rwdata, 10340K rodata, 2688K init, 5976K bss, 477504K reserved, 0K cma-reserved)
[    0.109279] Freeing SMP alternatives memory: 40K
[    0.255382] x86/mm: Memory block size: 128MB
[    0.633239] Freeing initrd memory: 56768K
[    0.636859] check: Scanning for low memory corruption every 60 seconds
[    0.922923] Freeing unused decrypted memory: 2036K
[    0.923550] Freeing unused kernel image (initmem) memory: 2688K
[    0.936446] Freeing unused kernel image (text/rodata gap) memory: 2036K
[    0.937019] Freeing unused kernel image (rodata/data gap) memory: 1948K
[    2.777602] Non-volatile memory driver v1.3
[    3.074212] amdgpu 0000:07:00.0: amdgpu: Trusted Memory Zone (TMZ) feature disabled as experimental (default)
[    3.314687] [TTM] Zone  kernel: Available graphics memory: 6038562 KiB
[    3.314688] [TTM] Zone   dma32: Available graphics memory: 2097152 KiB
[    3.314780] [drm] amdgpu: 4096M of VRAM memory ready
[    3.314782] [drm] amdgpu: 4096M of GTT memory ready.

I do not really know what I am looking for and would love any advice. Especially the fact that it showed it and I was able to use it confuses me. What could I have done wrong?

Update 1: I ran sudo dmidecode -t memory, which gives the output:

# dmidecode 3.2
Getting SMBIOS data from sysfs.
SMBIOS 3.3.0 present.
# SMBIOS implementations newer than version 3.2.0 are not
# fully supported by this version of dmidecode.

Handle 0x0001, DMI type 16, 23 bytes
Physical Memory Array
    Location: System Board Or Motherboard
    Use: System Memory
    Error Correction Type: None
    Maximum Capacity: 64 GB
    Error Information Handle: 0x0000
    Number Of Devices: 2

Handle 0x0008, DMI type 17, 92 bytes
Memory Device
    Array Handle: 0x0001
    Error Information Handle: 0x0007
    Total Width: 64 bits
    Data Width: 64 bits
    Size: 16384 MB
    Form Factor: SODIMM
    Set: None
    Locator: DIMM 0
    Bank Locator: P0 CHANNEL A
    Type: DDR4
    Type Detail: Synchronous Unbuffered (Unregistered)
    Speed: 3200 MT/s
    Manufacturer: Hynix
    Serial Number: 00000000
    Asset Tag: Not Specified
    Part Number: HMAB2GS6AMR6N-XN    
    Rank: 1
    Configured Memory Speed: 3200 MT/s
    Minimum Voltage: 1.2 V
    Maximum Voltage: 1.2 V
    Configured Voltage: 1.2 V
    Memory Technology: DRAM
    Memory Operating Mode Capability: Volatile memory
    Firmware Version: Unknown
    Module Manufacturer ID: Bank 1, Hex 0xAD
    Module Product ID: Unknown
    Memory Subsystem Controller Manufacturer ID: Unknown
    Memory Subsystem Controller Product ID: Unknown
    Non-Volatile Size: None
    Volatile Size: 16 GB
    Cache Size: None
    Logical Size: None

Handle 0x000B, DMI type 17, 92 bytes
Memory Device
    Array Handle: 0x0001
    Error Information Handle: 0x000A
    Total Width: Unknown
    Data Width: Unknown
    Size: No Module Installed
    Form Factor: Unknown
    Set: None
    Locator: DIMM 0
    Bank Locator: P0 CHANNEL B
    Type: Unknown
    Type Detail: Unknown
    Speed: Unknown
    Manufacturer: Null
    Serial Number: Null
    Asset Tag: Not Specified
    Part Number: Null
    Rank: Unknown
    Configured Memory Speed: Unknown
    Minimum Voltage: Unknown
    Maximum Voltage: Unknown
    Configured Voltage: Unknown
    Memory Technology: Unknown
    Memory Operating Mode Capability: Unknown
    Firmware Version: Unknown
    Module Manufacturer ID: Unknown
    Module Product ID: Unknown
    Memory Subsystem Controller Manufacturer ID: Unknown
    Memory Subsystem Controller Product ID: Unknown
    Non-Volatile Size: None
    Volatile Size: None
    Cache Size: None
    Logical Size: None

Update 2: My specs are:

CPU: AMD Ryzen™ 7 PRO (5850U)

GPU: Radeon RX Vega 8

RAM: 16 GB DDR4 3200 MHz (I don't know the company)
jp flag
Do you know what the physical hardware is? Is it by any chance 4 DIMMS of 4GB? If so, could you perhaps post the output of `sudo dmidecode -t memory`. (I don't know whether dmidecode is installed by default. Just install it, it's a useful tool)
jp flag
Also, could you provide what CPU this is? If this is an AMD APU (So, the AMD 'integrated graphics') you may have reserved 4GB in your firmware for the APU. I ask, because I see that the dmesg reports 4GB RAM for your graphics card, but if it's an APU and not a discrete graphics card, it will be taken from the main memory. Normally in your firmware this is set to "Automatic", but many people get the "tip" they should put it to "the maximum possible", and then are surprised so much main RAM is gone. Again, this only applies if you have an APU, not if you have a discrete graphics card.
Fadi avatar
co flag
run `sudo lshw -c memory` and check memory size
DeerFreak avatar
th flag
I posted the specs in Update 2. @jawtheshark Yes I have a Radeon RX Vega 8 integrated GPU. Does that mean I can't really get the missing RAM back? Or what are the steps to reverse this? Thank you
jp flag
Okay, so what we know is that you have exactly 1 DIMM sized 16GB. So, you *should* have 16GB and it is unlikely that the stick is defective for 25% and reports that as such. Howeevr, you do have an APU. The graphics card thus uses the system RAM and does not have its own VRAM.
jp flag
I think we are looking at the cause: the graphics part of the APU reserves 4GB of the system RAM for its use. I presume you set it that way, because I do not think this is a default setting. What you need to do it go into your firmware (BIOS/uEFI) and look for the option where you allocate RAM for the integrated graphics card. Set it back to "Auto". Alas, I cannot tell you where exactly that is, each firmware is different (BIOS/uEFI).
DeerFreak avatar
th flag
@jawtheshark I set the UMA Frame buffersize to auto (the setting it was already on) and it didnt change my RAM size back to normal. However setting it to only 1G increased the RAM as I would expect. So the problem definetly is the UMA. Is setting it manually dangerous? And why doesn't 'auto' restore my full RAM? Thank you so much
heynnema avatar
ru flag
AMD Ryzen processors are fussy about memory. Show me `sudo dmidecode -s bios-version` and tell me the EXACT make/model # of your computer or motherboard. Also go to https://www.memtest86.com/ and download/run their free `memtest` to test your memory. Get at least one complete pass of all the 4/4 tests to confirm good memory. This may take a few hours to complete.
jp flag
@DeerFreak Not setting it manually is not dangerous. It seems then that "Auto" then defaults to reserving 4GB for whatever reason. It says so in your dmesg, but I am indeed surprised it reserves that much on "Auto". If you have Windows, what behaviour does Windows show?
DeerFreak avatar
th flag
I only have a ubuntu istallation, but i could boot a windows stick real quick.
jp flag
@heynnema Yes, Ryzen CPUs are fussy, but given the configuration (1x16GB DIMM), this is most likely not a self-built rig (I'd even wager it's a laptop), so it is very unlikely that it's the RAM stick, especially it takes out exactly 4GB. A prebuilt system normally has correctly matched RAM to the CPU in order to avoid returns. Now, doing a memtest is a good idea in general, but it's very unlikely that it's the problem. Also, you should send people to the open source version http://www.memtest.org/
jp flag
@DeerFreak It was mostly out of curiosity. The thing is "Auto" normally means the operating system can request more (or less) RAM for the APU dynamically. In a normal desktop environment it would go with minimal and in a game it would take all. It may be that the Linux drivers do not support this, and thus simply grab all they can.
jp flag
I just sshed into my SteamBox. I built it a few years ago ans sports a Ryzen 3 2200G. I never bothered to check what amount of RAM is used, because even when it only had 8GB RAM everything worked fine and it's mostly used as a "console experience". It's been upgraded to 32GB RAM when the RAM was cheap. Regardless, the maximum the 2200G can reserve is 2GB and... indeed, I find exactly the same line in my dmesg: `[1.397340] [drm] amdgpu: 2048M of VRAM memory ready`. For `free -m` it also only shows me 30GB. I would say this is normal behaviour (on Linux) for AMD APUs.
jp flag
If you don't play games, and don't need the 4GB VRAM reservation (for example, the machine is mostly used for desktop applications), just reduce the reservation in your frimware. 1GB is plenty for normal desktop usage.
DeerFreak avatar
th flag
First of all thank you so much for helping me :) Secondly I am a little bit puzzled as I bought this computer specifically for coding and running code which is not gpu heavy. For that I have my second much bigger machine. So I wasn't expecting the internal GPU to interfere with pretty much anything.
jp flag
If you look at this kernel documentation: https://www.kernel.org/doc/html/latest/gpu/amdgpu.html You will notice the following parameter: `vramlimit (int) --> Restrict the total amount of VRAM in MiB for testing. The default is 0 (Use full VRAM).` So, there you are: default is to reserve all VRAM possible, and if "Auto" tells the system "my maximum is 4GB", it will grab all 4GB...
DeerFreak avatar
th flag
@heynnema Thank you for taking the time, but I think we solved the issue. I am going to close the issue.
heynnema avatar
ru flag
@jawtheshark memtest.org is a fork of memtest86.org. On the memtest.org site it says *"Here is Memtest86+ 5.31b, with many bug fixes in the core functions. This build is not ready for production yet, because it lacks some feedback from beta-testers"*. On memtest86.org it says *"MemTest86 is the original, free, stand alone memory testing software for x86 and ARM computers"*.
DeerFreak avatar
th flag
Yes, the computer I have is a laptop. I have got this model: https://www.lenovocampus.de/wp-content/uploads/2021/08/ThinkPadP14sGen2Datasheet-Final.pdf
jp flag
Yes, @heynnema and it is not open source, nor free software. Always prefer open and free software over proprietary software. Memtest86+ is merely free to use, not free software. There is a difference, and the difference is important.
Score:1
th flag

This answer has been mainly provided by jawtheshark in the comments. I am going to summarize it here to close the issue. The problem is that Linux takes, for integrated GPU's, a part of the RAM and uses it as VRAM. The graphics part of the APU reserves 4GB of the system RAM for its use. Looking at this kernel documentation: kernel.org/doc/html/latest/gpu/amdgpu.html The parameter: vramlimit (int) --> Restrict the total amount of VRAM in MiB for testing. The default is 0 (Use full VRAM). Which means that the 'auto' option for delegating RAM to the integrated GPU, delegates a large amount of RAM to the GPU. Since I only use the machine as a workstation, I will set the 'auto' option in bios to '1 GB', the minimum.

Score:0
sa flag

Ubuntu is not detecting all of the installed RAM capacity possibly due to a hardware fault on one of the RAM sticks which could optionally be replaced by a new RAM stick that has the same type, capacity and clock speed to restore the RAM capacity back to its original 16GB. Run the following command to show all the RAM slots and whether or not there is a RAM stick installed in each slot.

sudo dmidecode -t memory

Example of the partial results of sudo dmidecode -t memory :

Number Of Devices: 4

Handle 0x0011, DMI type 17, 84 bytes
Memory Device
    Array Handle: 0x0009
    Error Information Handle: 0x0010
    Total Width: Unknown
    Data Width: Unknown
    Size: No Module Installed

The complete results of the above example would show that the host computer has 4 RAM slots and two of the four RAM slots currently have a RAM module installed. It would also show the capacity of each installed RAM module and the maximum RAM capacity of the host computer.

DeerFreak avatar
th flag
Thank you for your answer. I ran the command and got the following stdout: ``` Handle 0x0008, DMI type 17, 92 bytes Memory Device [...] Size: 16384 MB [...] Handle 0x000B, DMI type 17, 92 bytes Memory Device [...] Size: No Module Installed [...] ``` If I am interpreting this correcty: I have two slots for RAM-Sticks. Only one is installed, but it would have the capacity, I am looking for (16 GiB). What is wrong with the first slot?
karel avatar
sa flag
Nothing is wrong with the RAM slot and your computer is detecting the RAM stick, but according to `free` only 12GB of the installed 16GB is available. I will research this terminal output and edit my question if I find anything worth posting.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.