You are not logged in.

#1 2023-12-04 11:24:04

Wild Penguin
Member
Registered: 2015-03-19
Posts: 390

[SOLVED] How to find out what has eaten 5GiB of my RAM

Hi,

I'm fairly certain it used not to be like this:

$ free -h
               total        used        free      shared  buff/cache   available
Mem:            11Gi       5,8Gi       4,4Gi        75Mi       1,7Gi       5,7Gi
Swap:           15Gi       1,8Gi        14Gi

But I had more usable RAM (the "total" column).

I have a 16GB RAM stick (soldered) in this laptop:

$ sudo inxi -CGMzm
Machine:
  Type: Laptop System: LENOVO product: 21A0CTO1WW v: ThinkPad P14s Gen 2a
    serial: <filter>
  Mobo: LENOVO model: 21A0CTO1WW serial: <filter> UEFI: LENOVO
    v: R1MET54W (1.24 ) date: 05/15/2023
Memory:
  System RAM: total: 16 GiB available: 11.51 GiB used: 5.9 GiB (51.3%)
  Array-1: capacity: 64 GiB slots: 2 modules: 1 EC: None
  Device-1: DIMM 0 type: DDR4 size: 16 GiB speed: 3200 MT/s
  Device-2: DIMM 0 type: no module installed
CPU:
  Info: 8-core model: AMD Ryzen 7 PRO 5850U with Radeon Graphics bits: 64
    type: MT MCP cache: L2: 4 MiB
  Speed (MHz): avg: 535 min/max: 400/4507 cores: 1: 1397 2: 1576 3: 400
    4: 400 5: 400 6: 400 7: 400 8: 400 9: 400 10: 400 11: 400 12: 400 13: 400
    14: 400 15: 400 16: 400
Graphics:
  Device-1: AMD Cezanne [Radeon Vega Series / Radeon Mobile Series]
    driver: amdgpu v: kernel
  Device-2: IMC Networks Integrated Camera driver: uvcvideo type: USB
  Display: server: X.Org v: 21.1.9 driver: X: loaded: modesetting
    dri: radeonsi gpu: amdgpu resolution: 1920x1080~60Hz
  API: EGL v: 1.5 drivers: radeonsi,swrast platforms: x11,surfaceless,device
  API: OpenGL v: 4.6 compat-v: 4.5 vendor: amd mesa v: 23.2.1-arch1.2
    renderer: AMD Radeon Graphics (renoir LLVM 16.0.6 DRM 3.54 6.6.3-arch1-1)
  API: Vulkan Message: No Vulkan data available.

I do have an IGP, but I do not understand where the 4GiB has gone. In the boot I can see:

Dec 04 12:03:33 catonthemove kernel: amdgpu 0000:07:00.0: amdgpu: GART: 1024M 0x0000000000000000 - 0x000000003FFFFFFF

And also:

Dec 04 12:03:33 catonthemove kernel: BIOS-provided physical RAM map:
Dec 04 12:03:33 catonthemove kernel: BIOS-e820: [mem 0x0000000000000000-0x000000000009efff] usable
Dec 04 12:03:33 catonthemove kernel: BIOS-e820: [mem 0x000000000009f000-0x000000000009ffff] reserved
Dec 04 12:03:33 catonthemove kernel: BIOS-e820: [mem 0x00000000000e0000-0x00000000000fffff] reserved
Dec 04 12:03:33 catonthemove kernel: BIOS-e820: [mem 0x0000000000100000-0x0000000009bfffff] usable
Dec 04 12:03:33 catonthemove kernel: BIOS-e820: [mem 0x0000000009c00000-0x0000000009da0fff] reserved
Dec 04 12:03:33 catonthemove kernel: BIOS-e820: [mem 0x0000000009da1000-0x0000000009efffff] usable
Dec 04 12:03:33 catonthemove kernel: BIOS-e820: [mem 0x0000000009f00000-0x0000000009f0cfff] ACPI NVS
Dec 04 12:03:33 catonthemove kernel: BIOS-e820: [mem 0x0000000009f0d000-0x00000000c4b7dfff] usable
Dec 04 12:03:33 catonthemove kernel: BIOS-e820: [mem 0x00000000c4b7e000-0x00000000cad7dfff] reserved
Dec 04 12:03:33 catonthemove kernel: BIOS-e820: [mem 0x00000000cad7e000-0x00000000cbd7dfff] ACPI NVS
Dec 04 12:03:33 catonthemove kernel: BIOS-e820: [mem 0x00000000cbd7e000-0x00000000cbdfdfff] ACPI data
Dec 04 12:03:33 catonthemove kernel: BIOS-e820: [mem 0x00000000cbdfe000-0x00000000cdffffff] usable
Dec 04 12:03:33 catonthemove kernel: BIOS-e820: [mem 0x00000000ce000000-0x00000000cfffffff] reserved
Dec 04 12:03:33 catonthemove kernel: BIOS-e820: [mem 0x00000000f8000000-0x00000000fbffffff] reserved
Dec 04 12:03:33 catonthemove kernel: BIOS-e820: [mem 0x00000000fdc00000-0x00000000fdcfffff] reserved
Dec 04 12:03:33 catonthemove kernel: BIOS-e820: [mem 0x00000000fed80000-0x00000000fed80fff] reserved
Dec 04 12:03:33 catonthemove kernel: BIOS-e820: [mem 0x0000000100000000-0x000000032e2fffff] usable
Dec 04 12:03:33 catonthemove kernel: BIOS-e820: [mem 0x000000032e300000-0x000000042fffffff] reserved
Dec 04 12:03:33 catonthemove kernel: NX (Execute Disable) protection: active
Dec 04 12:03:33 catonthemove kernel: APIC: Static calls initialized
Dec 04 12:03:33 catonthemove kernel: e820: update [mem 0x99b6a018-0x99b77857] usable ==> usable
Dec 04 12:03:33 catonthemove kernel: e820: update [mem 0x99b6a018-0x99b77857] usable ==> usable
Dec 04 12:03:33 catonthemove kernel: extended physical RAM map:
Dec 04 12:03:33 catonthemove kernel: reserve setup_data: [mem 0x0000000000000000-0x000000000009efff] usable
Dec 04 12:03:33 catonthemove kernel: reserve setup_data: [mem 0x000000000009f000-0x000000000009ffff] reserved
Dec 04 12:03:33 catonthemove kernel: reserve setup_data: [mem 0x00000000000e0000-0x00000000000fffff] reserved
Dec 04 12:03:33 catonthemove kernel: reserve setup_data: [mem 0x0000000000100000-0x0000000009bfffff] usable
Dec 04 12:03:33 catonthemove kernel: reserve setup_data: [mem 0x0000000009c00000-0x0000000009da0fff] reserved
Dec 04 12:03:33 catonthemove kernel: reserve setup_data: [mem 0x0000000009da1000-0x0000000009efffff] usable
Dec 04 12:03:33 catonthemove kernel: reserve setup_data: [mem 0x0000000009f00000-0x0000000009f0cfff] ACPI NVS
Dec 04 12:03:33 catonthemove kernel: reserve setup_data: [mem 0x0000000009f0d000-0x0000000099b6a017] usable
Dec 04 12:03:33 catonthemove kernel: reserve setup_data: [mem 0x0000000099b6a018-0x0000000099b77857] usable
Dec 04 12:03:33 catonthemove kernel: reserve setup_data: [mem 0x0000000099b77858-0x00000000c4b7dfff] usable
Dec 04 12:03:33 catonthemove kernel: reserve setup_data: [mem 0x00000000c4b7e000-0x00000000cad7dfff] reserved
Dec 04 12:03:33 catonthemove kernel: reserve setup_data: [mem 0x00000000cad7e000-0x00000000cbd7dfff] ACPI NVS
Dec 04 12:03:33 catonthemove kernel: reserve setup_data: [mem 0x00000000cbd7e000-0x00000000cbdfdfff] ACPI data
Dec 04 12:03:33 catonthemove kernel: reserve setup_data: [mem 0x00000000cbdfe000-0x00000000cdffffff] usable
Dec 04 12:03:33 catonthemove kernel: reserve setup_data: [mem 0x00000000ce000000-0x00000000cfffffff] reserved
Dec 04 12:03:33 catonthemove kernel: reserve setup_data: [mem 0x00000000f8000000-0x00000000fbffffff] reserved
Dec 04 12:03:33 catonthemove kernel: reserve setup_data: [mem 0x00000000fdc00000-0x00000000fdcfffff] reserved
Dec 04 12:03:33 catonthemove kernel: reserve setup_data: [mem 0x00000000fed80000-0x00000000fed80fff] reserved
Dec 04 12:03:33 catonthemove kernel: reserve setup_data: [mem 0x0000000100000000-0x000000032e2fffff] usable
Dec 04 12:03:33 catonthemove kernel: reserve setup_data: [mem 0x000000032e300000-0x000000042fffffff] reserved

And also:

$ dog /proc/meminfo 
MemTotal:       12067416 kB
MemFree:         4627000 kB
MemAvailable:    5971672 kB
Buffers:              12 kB
Cached:          1774104 kB
SwapCached:       148144 kB
Active:          3879260 kB
Inactive:        1139876 kB
Active(anon):    2923540 kB
Inactive(anon):   406208 kB
Active(file):     955720 kB
Inactive(file):   733668 kB
Unevictable:           0 kB
Mlocked:               0 kB
SwapTotal:      16777212 kB
SwapFree:       14935880 kB
Zswap:            401800 kB
Zswapped:        1551992 kB
Dirty:               844 kB
Writeback:             0 kB
AnonPages:       3198988 kB
Mapped:           555656 kB
Shmem:             84712 kB
KReclaimable:      73624 kB
Slab:             292612 kB
SReclaimable:      73624 kB
SUnreclaim:       218988 kB
KernelStack:       28192 kB
PageTables:        59940 kB
SecPageTables:         0 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:    22810920 kB
Committed_AS:   15462248 kB
VmallocTotal:   34359738367 kB
VmallocUsed:      103432 kB
VmallocChunk:          0 kB
Percpu:            13632 kB
HardwareCorrupted:     0 kB
AnonHugePages:    253952 kB
ShmemHugePages:        0 kB
ShmemPmdMapped:        0 kB
FileHugePages:     94208 kB
FilePmdMapped:     90112 kB
CmaTotal:              0 kB
CmaFree:               0 kB
Unaccepted:            0 kB
HugePages_Total:       0
HugePages_Free:        0
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB
Hugetlb:               0 kB
DirectMap4k:     1770312 kB
DirectMap2M:    10631168 kB
DirectMap1G:           0 kB

Any ideas where to look for and possibly reclaim some of the RAM for the system?

Cheers!

Last edited by Wild Penguin (2023-12-04 11:33:30)

Offline

#2 2023-12-04 11:33:17

Wild Penguin
Member
Registered: 2015-03-19
Posts: 390

Re: [SOLVED] How to find out what has eaten 5GiB of my RAM

Solved!

It was the framebuffer size setting in BIOS. IT seems like the IGP reservers the GART size and the frambuffer size.

The framebuffer was set to AUTO in the UEFI Setup. I presume the behavior changed at some Firmware upgrade, as it didn't use to eat that much and I don't recall changing the setting.

Setting the framebuffer to 1GB I only lose 2GB, which is fair considering I have an IGP smile. If I start doing something more graphics intensive, I can always increase it.

An exercise: can the framebuffer size be seen somewhere in the output I've posted (or elsewhere) in a running system? Would be cool if inxi or some other tool could tell it to confused users with IGPs in their computers.

EDIT: I believe the framebuffer + GART size is the last line in the RAM maps in the Kernel boot messages. Previously I had:

Dec 04 12:03:33 catonthemove kernel: BIOS-e820: [mem 0x000000032e300000-0x000000042fffffff] reserved 

but now I have:

Dec 04 13:29:49 catonthemove kernel: BIOS-e820: [mem 0x00000003ee300000-0x000000042fffffff] reserved 

(and the exact same lines in reserve setup_data, along with a previous "usable" entry). But that's not actually user readable / interpretable as such.

It's actually reserving framebuffer + 0,5GiB, I presume the GART can see 500GiB of the framebuffer or something, so they overlap....? I know little about GPU and IGP internals. Anyways, I'm "only" missing ~1.44GiB (according to inxi)

Last edited by Wild Penguin (2023-12-04 11:49:53)

Offline

Board footer

Powered by FluxBB