系统有 128 GB RAM,但重启后立即使用了 80 GB

系统有 128 GB RAM,但重启后立即使用了 80 GB

我的台式机系统有 128 GB 的 RAM,这是我最希望的自由的启动 Ubuntu 后。但是,free -m显示已使用 80 GB,只有 40 GB 可用。请注意,buff/cache只有不到 1 GB,因此这不是内存使用率高的原因。

              total        used        free      shared  buff/cache   available
Mem:           125G         80G         44G         20M        825M         42G
Swap:            8G          0B          8G

输出ps aux | awk '{sum+=$6} END {print sum / 1024}'

1368.03

基于另一个问题,这意味着我的进程仅使用 1GB 内存,但整个系统(不包括缓存)使用了 79 GB。

问题:到底是什么占用了我近 80 GB 的内存?启动一个占用约 40 GB 的进程会导致系统崩溃,启动时最初使用的 80 GB 不会被释放!

非常感谢您的见解!


输出ps -A --sort -rss -o comm,pmem | head -n 5

COMMAND         %MEM
mysqld           0.2
blueman-applet   0.0
caja             0.0
nm-applet        0.0

输出cat /proc/meminfo

MemTotal:       131947364 kB
MemFree:        45513984 kB
MemAvailable:   45083132 kB
Buffers:           24900 kB
Cached:           299012 kB
SwapCached:            0 kB
Active:          1337380 kB
Inactive:         211000 kB
Active(anon):    1228248 kB
Inactive(anon):    20812 kB
Active(file):     109132 kB
Inactive(file):   190188 kB
Unevictable:        6864 kB
Mlocked:            6900 kB
SwapTotal:      34553848 kB
SwapFree:       34553848 kB
Dirty:                16 kB
Writeback:             0 kB
AnonPages:       1231920 kB
Mapped:           206100 kB
Shmem:             20896 kB
Slab:             521948 kB
SReclaimable:      77492 kB
SUnreclaim:       444456 kB
KernelStack:       20880 kB
PageTables:        23056 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:    58584488 kB
Committed_AS:    4713068 kB
VmallocTotal:   34359738367 kB
VmallocUsed:           0 kB
VmallocChunk:          0 kB
HardwareCorrupted:     0 kB
AnonHugePages:         0 kB
ShmemHugePages:        0 kB
ShmemPmdMapped:        0 kB
CmaTotal:              0 kB
CmaFree:               0 kB
HugePages_Total:   40960
HugePages_Free:    40960
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB
DirectMap4k:      390128 kB
DirectMap2M:     8921088 kB
DirectMap1G:    124780544 kB

输出sudo lshw -C memory

  *-firmware              
       description: BIOS
       vendor: American Megatrends Inc.
       physical id: 0
       version: P3.50
       date: 12/24/2018
       size: 64KiB
       capacity: 15MiB
       capabilities: pci upgrade shadowing cdboot bootselect socketedrom edd int13floppy1200 int13floppy720 int13floppy2880 int5printscreen int9keyboard int14serial int17printer acpi usb biosbootspecification uefi
  *-memory
       description: System Memory
       physical id: 8
       slot: System board or motherboard
       size: 128GiB
     *-bank:0
          description: DIMM Synchronous 2134 MHz (0.5 ns)
          product: CMK128GX4M8X3800C19
          vendor: Unknown
          physical id: 0
          serial: 00000000
          slot: DIMM 0
          size: 16GiB
          width: 64 bits
          clock: 2134MHz (0.5ns)
     *-bank:1
          description: DIMM Synchronous 2134 MHz (0.5 ns)
          product: CMK128GX4M8X3800C19
          vendor: Unknown
          physical id: 1
          serial: 00000000
          slot: DIMM 1
          size: 16GiB
          width: 64 bits
          clock: 2134MHz (0.5ns)
     *-bank:2
          description: DIMM Synchronous 2134 MHz (0.5 ns)
          product: CMK128GX4M8X3800C19
          vendor: Unknown
          physical id: 2
          serial: 00000000
          slot: DIMM 0
          size: 16GiB
          width: 64 bits
          clock: 2134MHz (0.5ns)
     *-bank:3
          description: DIMM Synchronous 2134 MHz (0.5 ns)
          product: CMK128GX4M8X3800C19
          vendor: Unknown
          physical id: 3
          serial: 00000000
          slot: DIMM 1
          size: 16GiB
          width: 64 bits
          clock: 2134MHz (0.5ns)
     *-bank:4
          description: DIMM Synchronous 2134 MHz (0.5 ns)
          product: CMK128GX4M8X3800C19
          vendor: Unknown
          physical id: 4
          serial: 00000000
          slot: DIMM 0
          size: 16GiB
          width: 64 bits
          clock: 2134MHz (0.5ns)
     *-bank:5
          description: DIMM Synchronous 2134 MHz (0.5 ns)
          product: CMK128GX4M8X3800C19
          vendor: Unknown
          physical id: 5
          serial: 00000000
          slot: DIMM 1
          size: 16GiB
          width: 64 bits
          clock: 2134MHz (0.5ns)
     *-bank:6
          description: DIMM Synchronous 2134 MHz (0.5 ns)
          product: CMK128GX4M8X3800C19
          vendor: Unknown
          physical id: 6
          serial: 00000000
          slot: DIMM 0
          size: 16GiB
          width: 64 bits
          clock: 2134MHz (0.5ns)
     *-bank:7
          description: DIMM Synchronous 2134 MHz (0.5 ns)
          product: CMK128GX4M8X3800C19
          vendor: Unknown
          physical id: 7
          serial: 00000000
          slot: DIMM 1
          size: 16GiB
          width: 64 bits
          clock: 2134MHz (0.5ns)
  *-cache:0
       description: L1 cache
       physical id: b
       slot: L1 - Cache
       size: 3MiB
       capacity: 3MiB
       clock: 1GHz (1.0ns)
       capabilities: pipeline-burst internal write-back unified
       configuration: level=1
  *-cache:1
       description: L2 cache
       physical id: c
       slot: L2 - Cache
       size: 16MiB
       capacity: 16MiB
       clock: 1GHz (1.0ns)
       capabilities: pipeline-burst internal write-back unified
       configuration: level=2
  *-cache:2
       description: L3 cache
       physical id: d
       slot: L3 - Cache
       size: 64MiB
       capacity: 64MiB
       clock: 1GHz (1.0ns)
       capabilities: pipeline-burst internal write-back unified
       configuration: level=3

输出sudo grep Memory /var/log/kern.log | grep reserved

Jan 14 16:53:53 server2 kernel: [    0.000000] Memory: 131807432K/134091364K available (12300K kernel code, 2480K rwdata, 4208K rodata, 2428K init, 2704K bss, 2283932K reserved, 0K cma-reserved)
Jan 14 17:47:08 server2 kernel: [    0.000000] Memory: 131807432K/134091364K available (12300K kernel code, 2480K rwdata, 4208K rodata, 2428K init, 2704K bss, 2283932K reserved, 0K cma-reserved)
Jan 14 17:52:04 server2 kernel: [    0.000000] Memory: 131807436K/134091364K available (12300K kernel code, 2480K rwdata, 4208K rodata, 2428K init, 2704K bss, 2283928K reserved, 0K cma-reserved)
Jan 14 18:09:33 server2 kernel: [    0.000000] Memory: 131807436K/134091364K available (12300K kernel code, 2480K rwdata, 4208K rodata, 2428K init, 2704K bss, 2283928K reserved, 0K cma-reserved)
Jan 14 18:25:01 server2 kernel: [    0.000000] Memory: 131807436K/134091364K available (12300K kernel code, 2480K rwdata, 4208K rodata, 2428K init, 2704K bss, 2283928K reserved, 0K cma-reserved)
Jan 14 18:43:40 server2 kernel: [    0.000000] Memory: 131820396K/134091364K available (12300K kernel code, 2480K rwdata, 4208K rodata, 2428K init, 2704K bss, 2270968K reserved, 0K cma-reserved)
Jan 14 18:48:07 server2 kernel: [    0.000000] Memory: 131807428K/134091364K available (12300K kernel code, 2480K rwdata, 4208K rodata, 2428K init, 2704K bss, 2283936K reserved, 0K cma-reserved)

答案1

部分答案...

CPU: AMD Threadripper 2990WX
Motherboard: ASRock X399 Professional Gaming sTR4
128GB of RAM
  1. 更新主板 BIOS

    • 您当前处于 BIOS 版本 P3.50
    • 自 2020 年 1 月 8 日起,BIOS 3.80 可供下载这里
    • 确认这是适合您型号的正确网页#
    • 安装新 BIOS 前备份重要数据
    • 查看free -h命令确认内存使用情况
  2. https://www.memtest86.com/并下载/运行他们的免费记忆测试来测试你的记忆力。至少完成一次所有 4/4 测试以确认记忆力良好。这可能需要几个小时才能完成。

  3. 使用正确的 ESD 和电源程序,将所有 RAM DIMM 重新放入其插槽中。(等我告诉你更多有关此事的信息后再做这件事。

相关内容