-2

I am running Ubuntu 25.04 on a new ThinkPad L13, with 8GB of RAM. When I use the "free" command, it tells me I have just 6.1GB in total!

$ free -hw
               total        used        free      shared     buffers       cache   available
Mem:           6.1Gi       3.6Gi       1.0Gi       112Mi       172Mi       1.8Gi       2.5Gi

Here are the kernel boot messages regarding memory; they say quite a bit about system/video RAM, but I am not an expert so I cannot construct the "missing" 1.9GB from these figures.

May 15 09:59:40 mung kernel: Memory: 6289280K/7158200K available (21770K kernel code, 4579K rwdata, 15936K rodata, 5096K init, 4468K bss, 850456K reserved, 0K cma-reserved)
May 15 09:59:40 mung kernel: x86/mm: Memory block size: 128MB
May 15 09:59:40 mung kernel: Freeing initrd memory: 74372K
May 15 09:59:40 mung kernel: memory memory25: hash matches
May 15 09:59:40 mung kernel: Freeing unused decrypted memory: 2028K
May 15 09:59:40 mung kernel: Freeing unused kernel image (initmem) memory: 5096K
May 15 09:59:40 mung kernel: Freeing unused kernel image (text/rodata gap) memory: 756K
May 15 09:59:40 mung kernel: Freeing unused kernel image (rodata/data gap) memory: 448K
May 15 09:59:40 mung kernel: nvme nvme0: allocated 64 MiB host memory buffer (1 segment).
May 15 09:59:41 mung kernel: Non-volatile memory driver v1.3
May 15 09:59:44 mung kernel: amdgpu 0000:07:00.0: amdgpu: Trusted Memory Zone (TMZ) feature enabled
May 15 09:59:44 mung kernel: [drm] amdgpu: 1024M of VRAM memory ready
May 15 09:59:44 mung kernel: [drm] amdgpu: 3120M of GTT memory ready.

Can anyone explain why I am "losing" nearly 2GB of RAM? Well, I have been into the BIOS, and can confirm that 1GB is allocated to integrated graphics, but that "reserved" figure in the available RAM reported by the kernel message (nearly 1GB) is suspicous to me.

Here is some data for comparison (all machines have 8GB of physical RAM), first, an Intel NUC (Debian):

May 06 12:20:17 bonsai kernel: Memory: 3550328K/8282144K available (12295K kernel code, 2542K rwdata, 7640K rodata, 2680K init, 17688K bss, 340280K reserved, 0K cma-reserved)
                   total        used        free      shared  buff/cache   available
    Mem:           7.7Gi       2.1Gi       1.4Gi       419Mi       4.2Gi       4.8Gi

also, A Raspberry Pi 500 (PiOS):

May 11 15:51:08 orion kernel: Memory: 8145632K/8380416K available (13952K kernel code, 2264K rwdata, 4800K rodata, 5440K init, 647K bss, 162544K reserved, 65536K cma-reserved)
                   total        used        free      shared  buff/cache   available
    Mem:           7.9Gi       2.7Gi       2.2Gi       300Mi       3.4Gi       5.2Gi

(let's ignore that the NUC seem to be reporting ~3.55GB/~8GB, that one is for another day!). The NUC and the Pi give me nearly all of my RAM (remember we are talking about the "total" column here), but the Thinkpad takes nearly 2GB!

Anyhow, the question is, can I do anything to "recover" some of this lost memory? I am aware of this question, but my situation is much worse, and also I have provided more information.

This is not a question about swap, buffers, cache, or applications, it is about Ubuntu, the hardware, and the Linux kernel. This is fairly common hardware, and a standard Ubuntu installation. MX Linux live USB "reserves" 0.5GB less RAM than Ubuntu.

Enjoy your memory-hog of an OS people, I am long gone!

m4r35n357
  • 121
  • 6

2 Answers2

2

I would say this is probably natural. Some quick addition of the figures in the first line of the kernel boot messages shows 0.9Gb. If you have 1Gb allocated to integrated graphics then there is your 1.9Gb

In short your RAM isn't lost, it's used. See the answers for more info.

enter image description here

theYnot
  • 733
  • 5
  • 14
1

Answer created from information that was edited into the user's question, which was closed at the time and not eligible for answers

I have solved the problem by replacing Ubuntu with MX, and have recovered 0.5GB of physical RAM which, in conjunction with zram, is effectively 1GB extra RAM. Someone at Ubuntu really should address this. Some might consider 8GB of RAM to be "low-end", but I disagree!

For completeness, here is the equivalent data for MX (same hardware/BIOS settings)

Memory: 6763708K/7158200K available (17745K kernel code, 2157K rwdata, 11660K rodata, 3660K init, 3484K bss, 381512K reserved, 0K cma-reserved)
$ free -hw 
               total        used        free      shared     buffers       cache   available
Mem:           6.6Gi       2.3Gi       3.0Gi        70Mi       109Mi       1.5Gi       4.3Gi
NotTheDr01ds
  • 22,082