My Lenovo Notebook does not use all RAM

I own a Lenovo V155 Notebook with a Ryzen 3500U with 8GiB of RAM and I always noticed that Linux (Ubuntu 20.04) only uses 5.7GiB of 8GiB. So I digged a bit into this and found that the e820 and efi memory map do not specify all the memory. For one they have a few large holes and they don’t seem to reach to end (address of 8GiB).

reserve setup_data: [mem 0x0000000000000000-0x000000000009efff] usable
reserve setup_data: [mem 0x000000000009f000-0x000000000009ffff] reserved
reserve setup_data: [mem 0x00000000000e0000-0x00000000000fffff] reserved
reserve setup_data: [mem 0x0000000000100000-0x0000000009bfffff] usable
reserve setup_data: [mem 0x0000000009c00000-0x0000000009cd0fff] reserved
reserve setup_data: [mem 0x0000000009cd1000-0x0000000009efffff] usable
reserve setup_data: [mem 0x0000000009f00000-0x0000000009f0afff] ACPI NVS
reserve setup_data: [mem 0x0000000009f0b000-0x00000000b19f5017] usable
reserve setup_data: [mem 0x00000000b19f5018-0x00000000b1a02457] usable
reserve setup_data: [mem 0x00000000b1a02458-0x00000000b857dfff] usable
reserve setup_data: [mem 0x00000000b857e000-0x00000000bc77dfff] reserved
reserve setup_data: [mem 0x00000000bc77e000-0x00000000be77dfff] ACPI NVS
reserve setup_data: [mem 0x00000000be77e000-0x00000000be7fdfff] ACPI data
reserve setup_data: [mem 0x00000000be7fe000-0x00000000bf7fffff] usable
reserve setup_data: [mem 0x00000000bf800000-0x00000000bfffffff] reserved
reserve setup_data: [mem 0x00000000fd200000-0x00000000fd2fffff] reserved
reserve setup_data: [mem 0x00000000fed80000-0x00000000fed80fff] reserved
reserve setup_data: [mem 0x0000000100000000-0x00000001beffffff] usable

is the memory map from dmesg, which has (I guess) the following holes:

  • 978MiB: 0xbfffffff-0xfd200000 (partially used by GPU)
  • 27MiB: 0xfd2fffff-fed80000
  • 18MiB: 0xfed80fff-0x100000000
  • 410MiB: 0x1beffffff-0x1ffffffff (I would expect 0x1ffffffff as last address?)

I had a quick look into what grub’s lsmmap and lsefimmap show and while they show all entries and not just the merged ones it has the same holes.

I don’t really know whether the OEM Windows installation used all memory, after I bought the notebook.

Unfortunately my BIOS has basically no settings not even for the GPUs shared memory size. But lshw -C display tells me it uses memory:c0000000-cfffffff memory:d0000000-d01fffff ioport:1000(Größe=256) memory:d0800000-d087ffff which is a bit more than 256MiB. Which is in one of the holes, but not uses all of it.

  • Am I getting anything important wrong here?
  • Is there any way to debug this further?
  • Is there any way to manually specify further memory areas? (I guess by writing a kernel module? But besides that?)

Memory holes are just that, holes in the addressing space, it doesn’t mean that memory is reserved/unused. It’s up to the MMU to map the physical RAM into this address space and it’s usually done in a contiguous manner for performance reasons.

Exactly how much?

5.7GiB of 8GiB are used. >2GiB seems to be more than what a simple eGPU should use… and as mentioned lshw only claims ~256MiB are used by the GPU.

Memory holes are just that, holes in the addressing space, it doesn’t mean that memory is reserved/unused. It’s up to the MMU to map the physical RAM into this address space and it’s usually done in a contiguous manner for performance reasons.

Wouldn’t the kernel tell the MMU how/where to map the memory? And if it is not aware that it is allowed to use the address space, it shouldn’t map it?

How are you determining this ?

You’re not understanding a key difference here, this is address space, not actual memory.

Your computer uses memory addresses to access everything, literally everything, from the BIOS, ACPI tables, to PCIe devices, to the physical RAM itself.

Some address ranges are marked as “reserved” by the BIOS because they contain things that are needed for your system to operate, ie, the ACPI range is marked as reserved so the kernel doesn’t try to map something else there, breaking your entire system.

The keyword here is “Address”, it’s the address space to access physical devices, including your physical RAM.

If you remember the 3GB limit from 32-bit days, it’s because the addressing space was limited. For example, you have 0x100000000-0x1beffffff available, which is only 2.98GB of address space. This doesn’t mean addresses above 0x1beffffff is not available for use. The kernel maps the upper memory to addresses above this range so that it’s accessible to 64-bit applications.

Edit:

For eample, from dmidecode of my own system:

Handle 0x001B, DMI type 20, 35 bytes
Memory Device Mapped Address
        Starting Address: 0x00000000000
        Ending Address: 0x007FFFFFFFF
        Range Size: 32 GB
        Physical Device Handle: 0x001A
        Memory Array Mapped Address Handle: 0x000B
        Partition Row Position: Unknown
        Interleave Position: Unknown
        Interleaved Data Depth: Unknown

Handle 0x0015, DMI type 20, 35 bytes
Memory Device Mapped Address
        Starting Address: 0x00000000000
        Ending Address: 0x007FFFFFFFF
        Range Size: 32 GB
        Physical Device Handle: 0x0014
        Memory Array Mapped Address Handle: 0x000B
        Partition Row Position: Unknown
        Interleave Position: Unknown
        Interleaved Data Depth: Unknown

Note the starting address is 0x0, however there is a memory mapped address handle, which puts it elsewhere in the addressing space.

Handle 0x000B, DMI type 19, 31 bytes
Memory Array Mapped Address
        Starting Address: 0x00100000000
        Ending Address: 0x0107FFFFFFF
        Range Size: 62 GB
        Physical Array Handle: 0x0009
        Partition Width: 8

Ok, yeah I see. I assumed that the e820 and efi memory map referred only to the physical address space or even just the RAM. And does only map to memory and not peripherals.

I am not that familiar with x86 though in retrospective it is not really is that different on other architectures.

How are you determining this ?

free -mh tells me:

            total        used        free      shared  buff/cache   available
Mem:          5.7Gi       3.3Gi       294Mi        42Mi       2.2Gi       2.1Gi
Swap:          11Gi          0B        11Gi

The usable segments from the memory table (in my first post) also sum up to a bit below 6GiB.

Can you please provide the output of:

uname -a and dmidecode

> uname -a
Linux hostname 5.4.0-80-generic #90-Ubuntu SMP Fri Jul 9 22:49:44 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

> dmidecode
# dmidecode 3.2
Getting SMBIOS data from sysfs.
SMBIOS 3.1.1 present.
Table at 0xBA67A000.

Handle 0x0000, DMI type 18, 23 bytes
32-bit Memory Error Information
	Type: OK
	Granularity: Unknown
	Operation: Unknown
	Vendor Syndrome: Unknown
	Memory Array Address: Unknown
	Device Address: Unknown
	Resolution: Unknown

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

Handle 0x0002, DMI type 19, 31 bytes
Memory Array Mapped Address
	Starting Address: 0x00000000000
	Ending Address: 0x001FFFFFFFF
	Range Size: 8 GB
	Physical Array Handle: 0x0001
	Partition Width: 2

Handle 0x0003, DMI type 7, 27 bytes
Cache Information
	Socket Designation: L1 - Cache
	Configuration: Enabled, Not Socketed, Level 1
	Operational Mode: Write Back
	Location: Internal
	Installed Size: 384 kB
	Maximum Size: 384 kB
	Supported SRAM Types:
		Pipeline Burst
	Installed SRAM Type: Pipeline Burst
	Speed: 1 ns
	Error Correction Type: Multi-bit ECC
	System Type: Unified
	Associativity: 8-way Set-associative

Handle 0x0004, DMI type 7, 27 bytes
Cache Information
	Socket Designation: L2 - Cache
	Configuration: Enabled, Not Socketed, Level 2
	Operational Mode: Write Back
	Location: Internal
	Installed Size: 2048 kB
	Maximum Size: 2048 kB
	Supported SRAM Types:
		Pipeline Burst
	Installed SRAM Type: Pipeline Burst
	Speed: 1 ns
	Error Correction Type: Multi-bit ECC
	System Type: Unified
	Associativity: 8-way Set-associative

Handle 0x0005, DMI type 7, 27 bytes
Cache Information
	Socket Designation: L3 - Cache
	Configuration: Enabled, Not Socketed, Level 3
	Operational Mode: Write Back
	Location: Internal
	Installed Size: 4096 kB
	Maximum Size: 4096 kB
	Supported SRAM Types:
		Pipeline Burst
	Installed SRAM Type: Pipeline Burst
	Speed: 1 ns
	Error Correction Type: Multi-bit ECC
	System Type: Unified
	Associativity: 16-way Set-associative

Handle 0x0006, DMI type 4, 48 bytes
Processor Information
	Socket Designation: FP5
	Type: Central Processor
	Family: Zen
	Manufacturer: Advanced Micro Devices, Inc.
	ID: *********************
	Signature: Family 23, Model 24, Stepping 1
	Flags:
		FPU (Floating-point unit on-chip)
		VME (Virtual mode extension)
		DE (Debugging extension)
		PSE (Page size extension)
		TSC (Time stamp counter)
		MSR (Model specific registers)
		PAE (Physical address extension)
		MCE (Machine check exception)
		CX8 (CMPXCHG8 instruction supported)
		APIC (On-chip APIC hardware supported)
		SEP (Fast system call)
		MTRR (Memory type range registers)
		PGE (Page global enable)
		MCA (Machine check architecture)
		CMOV (Conditional move instruction supported)
		PAT (Page attribute table)
		PSE-36 (36-bit page size extension)
		CLFSH (CLFLUSH instruction supported)
		MMX (MMX technology supported)
		FXSR (FXSAVE and FXSTOR instructions supported)
		SSE (Streaming SIMD extensions)
		SSE2 (Streaming SIMD extensions 2)
		HTT (Multi-threading)
	Version: AMD Ryzen 5 3500U with Radeon Vega Mobile Gfx  
	Voltage: 1.2 V
	External Clock: 100 MHz
	Max Speed: 3700 MHz
	Current Speed: 2100 MHz
	Status: Populated, Enabled
	Upgrade: None
	L1 Cache Handle: 0x0003
	L2 Cache Handle: 0x0004
	L3 Cache Handle: 0x0005
	Serial Number: Unknown
	Asset Tag: Unknown
	Part Number: Unknown
	Core Count: 4
	Core Enabled: 4
	Thread Count: 8
	Characteristics:
		64-bit capable
		Multi-Core
		Hardware Thread
		Execute Protection
		Enhanced Virtualization
		Power/Performance Control

Handle 0x0007, DMI type 18, 23 bytes
32-bit Memory Error Information
	Type: OK
	Granularity: Unknown
	Operation: Unknown
	Vendor Syndrome: Unknown
	Memory Array Address: Unknown
	Device Address: Unknown
	Resolution: Unknown

Handle 0x0008, DMI type 17, 40 bytes
Memory Device
	Array Handle: 0x0001
	Error Information Handle: 0x0007
	Total Width: 64 bits
	Data Width: 64 bits
	Size: 4096 MB
	Form Factor: SODIMM
	Set: None
	Locator: DIMM 0
	Bank Locator: P0 CHANNEL A
	Type: DDR4
	Type Detail: Synchronous Unbuffered (Unregistered)
	Speed: 2400 MT/s
	Manufacturer: Hynix
	Serial Number: 73135358
	Asset Tag: Not Specified
	Part Number: HMA851S6JJR6N-VK    
	Rank: 1
	Configured Memory Speed: 2400 MT/s
	Minimum Voltage: 1.2 V
	Maximum Voltage: 1.2 V
	Configured Voltage: 1.2 V

Handle 0x0009, DMI type 20, 35 bytes
Memory Device Mapped Address
	Starting Address: 0x00000000000
	Ending Address: 0x001FFFFFFFF
	Range Size: 8 GB
	Physical Device Handle: 0x0008
	Memory Array Mapped Address Handle: 0x0002
	Partition Row Position: Unknown
	Interleave Position: Unknown
	Interleaved Data Depth: Unknown

Handle 0x000A, DMI type 18, 23 bytes
32-bit Memory Error Information
	Type: OK
	Granularity: Unknown
	Operation: Unknown
	Vendor Syndrome: Unknown
	Memory Array Address: Unknown
	Device Address: Unknown
	Resolution: Unknown

Handle 0x000B, DMI type 17, 40 bytes
Memory Device
	Array Handle: 0x0001
	Error Information Handle: 0x000A
	Total Width: 64 bits
	Data Width: 64 bits
	Size: 4096 MB
	Form Factor: SODIMM
	Set: None
	Locator: DIMM 0
	Bank Locator: P0 CHANNEL B
	Type: DDR4
	Type Detail: Synchronous Unbuffered (Unregistered)
	Speed: 2400 MT/s
	Manufacturer: Micron Technology
	Serial Number: 00000000
	Asset Tag: Not Specified
	Part Number: 4ATF51264HZ-2G6E!   
	Rank: 1
	Configured Memory Speed: 2400 MT/s
	Minimum Voltage: 1.2 V
	Maximum Voltage: 1.2 V
	Configured Voltage: 1.2 V

Handle 0x000C, DMI type 20, 35 bytes
Memory Device Mapped Address
	Starting Address: 0x00000000000
	Ending Address: 0x001FFFFFFFF
	Range Size: 8 GB
	Physical Device Handle: 0x000B
	Memory Array Mapped Address Handle: 0x0002
	Partition Row Position: Unknown
	Interleave Position: Unknown
	Interleaved Data Depth: Unknown

Handle 0x0011, DMI type 8, 9 bytes
Port Connector Information
	Internal Reference Designator: J2304, J2300
	Internal Connector Type: None
	External Reference Designator: Matrix Keyboard
	External Connector Type: PS/2
	Port Type: Keyboard Port

Handle 0x0012, DMI type 8, 9 bytes
Port Connector Information
	Internal Reference Designator: J3811
	Internal Connector Type: None
	External Reference Designator: Touch Pad
	External Connector Type: PS/2
	Port Type: Mouse Port

Handle 0x0013, DMI type 8, 9 bytes
Port Connector Information
	Internal Reference Designator: J1300
	Internal Connector Type: None
	External Reference Designator: BCM5762B0KMLG External LAN
	External Connector Type: RJ-45
	Port Type: Network Port

Handle 0x0014, DMI type 8, 9 bytes
Port Connector Information
	Internal Reference Designator: J1500
	Internal Connector Type: None
	External Reference Designator: USB 3.1
	External Connector Type: Access Bus (USB)
	Port Type: USB

Handle 0x0015, DMI type 8, 9 bytes
Port Connector Information
	Internal Reference Designator: J1501
	Internal Connector Type: None
	External Reference Designator: USB 3.1 Type-C
	External Connector Type: Access Bus (USB)
	Port Type: USB

Handle 0x0016, DMI type 8, 9 bytes
Port Connector Information
	Internal Reference Designator: J1502
	Internal Connector Type: None
	External Reference Designator: USB 3.1
	External Connector Type: Access Bus (USB)
	Port Type: USB

Handle 0x0017, DMI type 8, 9 bytes
Port Connector Information
	Internal Reference Designator: J1503
	Internal Connector Type: None
	External Reference Designator: USB 3.1 Type-C
	External Connector Type: Access Bus (USB)
	Port Type: USB

Handle 0x0018, DMI type 8, 9 bytes
Port Connector Information
	Internal Reference Designator: J1504
	Internal Connector Type: None
	External Reference Designator: USB 3.0
	External Connector Type: Access Bus (USB)
	Port Type: USB

Handle 0x0019, DMI type 8, 9 bytes
Port Connector Information
	Internal Reference Designator: J1701
	Internal Connector Type: None
	External Reference Designator: SATA 0 (HDD)
	External Connector Type: SAS/SATA Plug Receptacle
	Port Type: SATA

Handle 0x001A, DMI type 8, 9 bytes
Port Connector Information
	Internal Reference Designator: J1703
	Internal Connector Type: None
	External Reference Designator: SATA 1 (Cable SATA ODD)
	External Connector Type: SAS/SATA Plug Receptacle
	Port Type: SATA

Handle 0x001B, DMI type 8, 9 bytes
Port Connector Information
	Internal Reference Designator: J2102
	Internal Connector Type: None
	External Reference Designator: Microphone
	External Connector Type: Mini Jack (headphones)
	Port Type: Audio Port

Handle 0x001C, DMI type 8, 9 bytes
Port Connector Information
	Internal Reference Designator: J2103
	Internal Connector Type: None
	External Reference Designator: Headphone
	External Connector Type: Mini Jack (headphones)
	Port Type: Audio Port

Handle 0x001D, DMI type 8, 9 bytes
Port Connector Information
	Internal Reference Designator: J1100
	Internal Connector Type: None
	External Reference Designator: Display Port0
	External Connector Type: Other
	Port Type: Video Port

Handle 0x001E, DMI type 8, 9 bytes
Port Connector Information
	Internal Reference Designator: J1101
	Internal Connector Type: None
	External Reference Designator: Display Port1
	External Connector Type: Other
	Port Type: Video Port

Handle 0x001F, DMI type 9, 17 bytes
System Slot Information
	Designation: PCI-E x8 (J3604)
	Type: x8 PCI Express x8
	Current Usage: Available
	Length: Short
	ID: 1
	Characteristics:
		3.3 V is provided
		PME signal is supported
		Hot-plug devices are supported
	Bus Address: 0200:00:01.1

Handle 0x0020, DMI type 9, 17 bytes
System Slot Information
	Designation: PCI-E x8 (J3606)
	Type: x4 PCI Express x4
	Current Usage: Available
	Length: Short
	ID: 2
	Characteristics:
		3.3 V is provided
		PME signal is supported
		Hot-plug devices are supported
	Bus Address: 0200:00:01.6

Handle 0x0021, DMI type 9, 17 bytes
System Slot Information
	Designation: M.2 PCI-E Connector (J3711)
	Type: x1 M.2 Socket 1-SD
	Current Usage: Available
	Length: Short
	Characteristics:
		3.3 V is provided
		PME signal is supported
		Hot-plug devices are supported
	Bus Address: 0200:00:01.2

Handle 0x0022, DMI type 9, 17 bytes
System Slot Information
	Designation: M.2 WWAN Connector (J3712)
	Type: x1 M.2 Socket 2
	Current Usage: Available
	Length: Short
	Characteristics:
		3.3 V is provided
		PME signal is supported
		Hot-plug devices are supported
	Bus Address: 0200:00:01.4

Handle 0x0023, DMI type 9, 17 bytes
System Slot Information
	Designation: M.2 PCIE SSD Connector (J3704)
	Type: x2 M.2 Socket 3
	Current Usage: Available
	Length: Short
	Characteristics:
		3.3 V is provided
		PME signal is supported
		Hot-plug devices are supported
	Bus Address: 0200:00:01.7

Handle 0x0024, DMI type 9, 17 bytes
System Slot Information
	Designation: M.2 RVD WLAN Connector (J3709)
	Type: x1 M.2 Socket 1-SD
	Current Usage: Available
	Length: Short
	Characteristics:
		3.3 V is provided
		PME signal is supported
		Hot-plug devices are supported
	Bus Address: 0200:00:01.5

Handle 0x0025, DMI type 10, 6 bytes
On Board Device Information
	Type: Video
	Status: Enabled
	Description: AMD Picasso Ridge FP5 GPU

Handle 0x0026, DMI type 10, 6 bytes
On Board Device Information
	Type: Sound
	Status: Enabled
	Description: AZALIA HD Audio

Handle 0x0027, DMI type 10, 6 bytes
On Board Device Information
	Type: SATA Controller
	Status: Enabled
	Description: AMD Picasso Ridge FP5

Handle 0x0028, DMI type 10, 6 bytes
On Board Device Information
	Type: Unknown
	Status: Enabled
	Description: ST TPM ST33TPMESPI

Handle 0x0029, DMI type 11, 5 bytes
OEM Strings
	String 1: OEM default string

Handle 0x002A, DMI type 13, 22 bytes
BIOS Language Information
	Language Description Format: Abbreviated
	Installable Languages: 6
		en-US
		fr-FR
		ja-JP
		ko-KR
		zh-CHT
		zh-CHS
	Currently Installed Language: en-US

Handle 0x002C, DMI type 32, 11 bytes
System Boot Information
	Status: No errors detected

Handle 0x002E, DMI type 133, 5 bytes
OEM-specific Type
	Header and Data:
		85 05 2E 00 01
	Strings:
		KHOIHGIUCCHHII

Handle 0x002B, DMI type 24, 5 bytes
Hardware Security
	Power-On Password Status: Disabled
	Keyboard Password Status: Disabled
	Administrator Password Status: Disabled
	Front Panel Reset Status: Disabled

Handle 0x002F, DMI type 248, 18 bytes
OEM-specific Type
	Header and Data:
		F8 12 2F 00 AC AC AA 17 00 00 00 00 00 00 00 00
		00 00

Handle 0x000D, DMI type 0, 24 bytes
BIOS Information
	Vendor: LENOVO
	Version: ARCN32WW
	Release Date: 07/11/2019
	Address: 0xE0000
	Runtime Size: 128 kB
	ROM Size: 8192 kB
	Characteristics:
		PCI is supported
		BIOS is upgradeable
		BIOS shadowing is allowed
		Boot from CD is supported
		Selectable boot is supported
		EDD is supported
		Print screen service is supported (int 5h)
		8042 keyboard services are supported (int 9h)
		Serial services are supported (int 14h)
		Printer services are supported (int 17h)
		CGA/mono video services are supported (int 10h)
		ACPI is supported
		USB legacy is supported
		BIOS boot specification is supported
		Function key-initiated network boot is supported
		Targeted content distribution is supported
		UEFI is supported
	BIOS Revision: 1.32
	Firmware Revision: 1.32

Handle 0x000E, DMI type 1, 27 bytes
System Information
	Manufacturer: LENOVO
	Product Name: 81V5
	Version: Lenovo V155-15API
	Serial Number: PF1YZ536
	UUID: fe899b10-f0b3-11e9-80db-f875a4029a04
	Wake-up Type: Power Switch
	SKU Number: LENOVO_MT_81V5_BU_idea_FM_V155-15API
	Family: V155-15API

Handle 0x000F, DMI type 2, 15 bytes
Base Board Information
	Manufacturer: LENOVO
	Product Name: LNVNB161216
	Version: SDK0J40700WIN
	Serial Number: PF1YZ536
	Asset Tag: No Asset Tag
	Features:
		Board is a hosting board
		Board is replaceable
	Location In Chassis: Chassis Location Unknown
	Chassis Handle: 0x0000
	Type: Motherboard
	Contained Object Handles: 0

Handle 0x0010, DMI type 3, 22 bytes
Chassis Information
	Manufacturer: LENOVO
	Type: Notebook
	Lock: Not Present
	Version: Lenovo V155-15API
	Serial Number: PF1YZ536
	Asset Tag: No Asset Tag
	Boot-up State: Safe
	Power Supply State: Safe
	Thermal State: Other
	Security Status: Other
	OEM Information: 0x00000000
	Height: Unspecified
	Number Of Power Cords: 1
	Contained Elements: 0
	SKU Number: Not Specified

Handle 0x002D, DMI type 200, 16 bytes
OEM-specific Type
	Header and Data:
		C8 10 2D 00 01 02 01 27 01 14 01 20 B0 80 01 20
	Strings:
		IdeaPad
		81V50008GE

Handle 0x0030, DMI type 15, 31 bytes
System Event Log
	Area Length: 1986 bytes
	Header Start Offset: 0x0000
	Header Length: 16 bytes
	Data Start Offset: 0x0010
	Access Method: General-purpose non-volatile data functions
	Access Address: 0x00F0
	Status: Valid, Not Full
	Change Token: 0x0000007B
	Header Format: Type 1
	Supported Log Type Descriptors: 4
	Descriptor 1: POST error
	Data Format 1: POST results bitmap
	Descriptor 2: PCI system error
	Data Format 2: None
	Descriptor 3: System reconfigured
	Data Format 3: None
	Descriptor 4: Log area reset/cleared
	Data Format 4: None

Handle 0xFEFF, DMI type 127, 4 bytes
End Of Table
Handle 0x0002, DMI type 19, 31 bytes
Memory Array Mapped Address
	Starting Address: 0x00000000000
	Ending Address: 0x001FFFFFFFF
	Range Size: 8 GB
	Physical Array Handle: 0x0001
	Partition Width: 2

It’s mapped to 0x0, so these holes are playing a part in your system, unfortunately as it’s a laptop I don’t think there is much you can do about it as the BIOS configuration options on them are very limited.

As you can see here though, the entire range is mapped.

I looked a bit more into the iGPU RAM usage and apparently some BIOS will actually reserve 2GiB for the GPU. So I ran vulkaninfo and yeah apparently the GPU actually has 2GiB for itself:

VkPhysicalDeviceMemoryProperties:
=================================
memoryHeaps: count = 1
	memoryHeaps[0]:
		size   = 2147483648 (0x80000000) (2.00 GiB)
		budget = 0
		usage  = 0
		flags:
			MEMORY_HEAP_DEVICE_LOCAL_BIT
memoryTypes: count = 1
	memoryTypes[0]:
		heapIndex     = 0
		propertyFlags = 0x000f:
			MEMORY_PROPERTY_DEVICE_LOCAL_BIT
			MEMORY_PROPERTY_HOST_VISIBLE_BIT
			MEMORY_PROPERTY_HOST_COHERENT_BIT
			MEMORY_PROPERTY_HOST_CACHED_BIT
		usable for:
			IMAGE_TILING_OPTIMAL: color images, FORMAT_D16_UNORM, FORMAT_X8_D24_UNORM_PACK32, FORMAT_D32_SFLOAT, FORMAT_S8_UINT, FORMAT_D24_UNORM_S8_UINT, FORMAT_D32_SFLOAT_S8_UINT
			IMAGE_TILING_LINEAR: color images

AFAIK if needed more RAM could be mapped by the GPU driver anyway, so this is kinda stupid especially without any option in the BIOS :(.

Perhaps you will need to seek help on wimsbios, someone there might have hacked your bios to unlock the extra configuration options if they are hidden.

@lal1212 You should update your UEFI/BIOS to see if anything changes.
https://pcsupport.lenovo.com/de/en/products/laptops-and-netbooks/lenovo-v-series-laptops/v155-15api/downloads/ds525618-bios-update-for-windows-10-64-bit-l340-15api-l340-17api-l340-15api-touch-v155-15api