Linux 看到 20GB 内存而不是 24GB

Linux 看到 20GB 内存而不是 24GB

我曾经有两个内存条,每个 8GB。我把其中一根换成了 16G 内存条,原以为现在总共有 24GB,但实际只有 20GB。 free -h 的结果:

              total        used        free      shared  buff/cache   available
Mem:           19Gi       2.8Gi        12Gi       105Mi       3.9Gi        16Gi
Swap:         2.0Gi          0B       2.0Gi

猫 /proc/meminfo

MemTotal:       20292048 kB
MemFree:        13254056 kB
MemAvailable:   16923208 kB
Buffers:          269448 kB
Cached:          3706108 kB
SwapCached:            0 kB
Active:          1319968 kB
Inactive:        4874796 kB
Active(anon):      14752 kB
Inactive(anon):  2312796 kB
Active(file):    1305216 kB
Inactive(file):  2562000 kB
Unevictable:         132 kB
Mlocked:             132 kB
SwapTotal:       2097148 kB
SwapFree:        2097148 kB
Dirty:               524 kB
Writeback:             0 kB
AnonPages:       2219512 kB
Mapped:          1341800 kB
Shmem:            108248 kB
KReclaimable:     159592 kB
Slab:             372516 kB
SReclaimable:     159592 kB
SUnreclaim:       212924 kB
KernelStack:       23104 kB
PageTables:        56624 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:    12243172 kB
Committed_AS:   13539940 kB
VmallocTotal:   34359738367 kB
VmallocUsed:       67940 kB
VmallocChunk:          0 kB
Percpu:            25088 kB
HardwareCorrupted:     0 kB
AnonHugePages:         0 kB
ShmemHugePages:        0 kB
ShmemPmdMapped:        0 kB
FileHugePages:         0 kB
FilePmdMapped:         0 kB
HugePages_Total:       0
HugePages_Free:        0
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB
Hugetlb:               0 kB
DirectMap4k:      635844 kB
DirectMap2M:    10717184 kB

sudo dmidecode -t 内存

    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 0x0022, 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: 0x0025
    Number Of Devices: 2

Handle 0x0023, DMI type 17, 92 bytes
Memory Device
    Array Handle: 0x0022
    Error Information Handle: 0x0026
    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: Unknown
    Serial Number: E81F0ECB
    Asset Tag: Not Specified
    Part Number: CT16G4SFRA32A.M16FR
    Rank: 2
    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 6, Hex 0x9B
    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 0x0024, DMI type 17, 92 bytes
Memory Device
    Array Handle: 0x0022
    Error Information Handle: 0x0027
    Total Width: 64 bits
    Data Width: 64 bits
    Size: 8192 MB
    Form Factor: SODIMM
    Set: None
    Locator: DIMM 0
    Bank Locator: P0 CHANNEL B
    Type: DDR4
    Type Detail: Synchronous Unbuffered (Unregistered)
    Speed: 3200 MT/s
    Manufacturer: Samsung
    Serial Number: 00000000
    Asset Tag: Not Specified
    Part Number: M471A1G44AB0-CWE    
    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 0xCE
    Module Product ID: Unknown
    Memory Subsystem Controller Manufacturer ID: Unknown
    Memory Subsystem Controller Product ID: Unknown
    Non-Volatile Size: None
    Volatile Size: 8 GB
    Cache Size: None
    Logical Size: None

Linux:Ubuntu 20.04.6 LTS

我可以采取什么措施来查看我的所有 RAM 还是这是硬件问题?

UPD Journalctl -b0 -k 日志:

    BIOS-provided physical RAM map:
BIOS-e820: [mem 0x0000000000000000-0x000000000009efff] usable
BIOS-e820: [mem 0x000000000009f000-0x00000000000bffff] reserved
BIOS-e820: [mem 0x0000000000100000-0x0000000009efffff] usable
BIOS-e820: [mem 0x0000000009f00000-0x0000000009f0efff] ACPI NVS
BIOS-e820: [mem 0x0000000009f0f000-0x00000000b89e8fff] usable
BIOS-e820: [mem 0x00000000b89e9000-0x00000000babe8fff] reserved
BIOS-e820: [mem 0x00000000babe9000-0x00000000c8dfefff] usable
BIOS-e820: [mem 0x00000000c8dff000-0x00000000cbdfefff] reserved
BIOS-e820: [mem 0x00000000cbdff000-0x00000000cdf7efff] ACPI NVS
BIOS-e820: [mem 0x00000000cdf7f000-0x00000000cdffefff] ACPI data
BIOS-e820: [mem 0x00000000cdfff000-0x00000000cdffffff] usable
BIOS-e820: [mem 0x00000000ce000000-0x00000000cfffffff] reserved
BIOS-e820: [mem 0x00000000f8000000-0x00000000fbffffff] reserved
BIOS-e820: [mem 0x00000000fdc00000-0x00000000fdcfffff] reserved
BIOS-e820: [mem 0x00000000fe000000-0x00000000fe0fffff] reserved
BIOS-e820: [mem 0x00000000fec00000-0x00000000fec01fff] reserved
BIOS-e820: [mem 0x00000000fec10000-0x00000000fec10fff] reserved
BIOS-e820: [mem 0x00000000fec20000-0x00000000fec20fff] reserved
BIOS-e820: [mem 0x00000000fed80000-0x00000000fed81fff] reserved
BIOS-e820: [mem 0x00000000fee00000-0x00000000fee00fff] reserved
BIOS-e820: [mem 0x00000000ff000000-0x00000000ffffffff] reserved
BIOS-e820: [mem 0x0000000100000000-0x000000052e2fffff] usable
BIOS-e820: [mem 0x000000052e300000-0x000000062fffffff] reserved

extended physical RAM map:
reserve setup_data: [mem 0x0000000000000000-0x000000000009efff] usable
reserve setup_data: [mem 0x000000000009f000-0x00000000000bffff] reserved
reserve setup_data: [mem 0x0000000000100000-0x0000000009efffff] usable
reserve setup_data: [mem 0x0000000009f00000-0x0000000009f0efff] ACPI NVS
reserve setup_data: [mem 0x0000000009f0f000-0x00000000adb86017] usable
reserve setup_data: [mem 0x00000000adb86018-0x00000000adb93857] usable
reserve setup_data: [mem 0x00000000adb93858-0x00000000b2f69017] usable
reserve setup_data: [mem 0x00000000b2f69018-0x00000000b2f77057] usable
reserve setup_data: [mem 0x00000000b2f77058-0x00000000b89e8fff] usable
reserve setup_data: [mem 0x00000000b89e9000-0x00000000babe8fff] reserved
reserve setup_data: [mem 0x00000000babe9000-0x00000000c8dfefff] usable
reserve setup_data: [mem 0x00000000c8dff000-0x00000000cbdfefff] reserved
reserve setup_data: [mem 0x00000000cbdff000-0x00000000cdf7efff] ACPI NVS
reserve setup_data: [mem 0x00000000cdf7f000-0x00000000cdffefff] ACPI data
reserve setup_data: [mem 0x00000000cdfff000-0x00000000cdffffff] usable
reserve setup_data: [mem 0x00000000ce000000-0x00000000cfffffff] reserved
reserve setup_data: [mem 0x00000000f8000000-0x00000000fbffffff] reserved
reserve setup_data: [mem 0x00000000fdc00000-0x00000000fdcfffff] reserved
reserve setup_data: [mem 0x00000000fe000000-0x00000000fe0fffff] reserved
reserve setup_data: [mem 0x00000000fec00000-0x00000000fec01fff] reserved
reserve setup_data: [mem 0x00000000fec10000-0x00000000fec10fff] reserved
reserve setup_data: [mem 0x00000000fec20000-0x00000000fec20fff] reserved
reserve setup_data: [mem 0x00000000fed80000-0x00000000fed81fff] reserved
reserve setup_data: [mem 0x00000000fee00000-0x00000000fee00fff] reserved
reserve setup_data: [mem 0x00000000ff000000-0x00000000ffffffff] reserved
reserve setup_data: [mem 0x0000000100000000-0x000000052e2fffff] usable
reserve setup_data: [mem 0x000000052e300000-0x000000062fffffff] reserved

e820: reserve RAM buffer [mem 0x0009f000-0x0009ffff]
e820: reserve RAM buffer [mem 0x09f00000-0x0bffffff]
e820: reserve RAM buffer [mem 0xadb86018-0xafffffff]
e820: reserve RAM buffer [mem 0xb2f69018-0xb3ffffff]
e820: reserve RAM buffer [mem 0xb321f000-0xb3ffffff]
e820: reserve RAM buffer [mem 0xb3351000-0xb3ffffff]
e820: reserve RAM buffer [mem 0xb89e9000-0xbbffffff]
e820: reserve RAM buffer [mem 0xc8dff000-0xcbffffff]
e820: reserve RAM buffer [mem 0xce000000-0xcfffffff]
e820: reserve RAM buffer [mem 0x52e300000-0x52fffffff]

[drm] vm size is 262144 GB, 4 levels, block size is 9-bit, fragment size is 9-bit
amdgpu 0000:05:00.0: amdgpu: VRAM: 4096M 0x000000F400000000 - 0x000000F4FFFFFFFF (4096M used)
amdgpu 0000:05:00.0: amdgpu: GART: 1024M 0x0000000000000000 - 0x000000003FFFFFFF
amdgpu 0000:05:00.0: amdgpu: AGP: 267419648M 0x000000F800000000 - 0x0000FFFFFFFFFFFF
[drm] Detected VRAM RAM=4096M, BAR=4096M
[drm] RAM width 128bits DDR4
[drm] amdgpu: 4096M of VRAM memory ready
[drm] amdgpu: 4096M of GTT memory ready.
[drm] GART: num cpu pages 262144, num gpu pages 262144
[drm] PCIE GART of 1024M enabled.
[drm] PTB located at 0x000000F400900000

答案1

根据您发布的日志和描述的行为,我相信您的 AMD Ryzen 7 5700U 也是集成显卡,没有自己的 RAM。

您的 BIOS 中可能有一个选项可以调整集成显卡 VRAM,这将从您安装的系统 RAM 中占用 RAM。

您的日志当前显示 4096M 已分配给您的集成显卡 VRAM,因此您可能认为您的系统无法使用该 RAM 量。

相关内容