Linux 中的所有内存都没有被消耗

Linux 中的所有内存都没有被消耗

我有一台运行 Ubuntu 5.15 内核的 8GB 机器。即使重新启动后,我也只有 1GB 可用内存。我尝试了free -mcat /proc/meminfo技巧ps aux来列出最消耗内存的进程(最消耗的是 200MB)。我在下面提供这些的输出。这可能是什么原因以及如何解决?

MemTotal:        7751740 kB
MemFree:          472272 kB
MemAvailable:     962800 kB
Buffers:           39668 kB
Cached:           652640 kB
SwapCached:            0 kB
Active:           218316 kB
Inactive:         816804 kB
Active(anon):       2512 kB
Inactive(anon):   349956 kB
Active(file):     215804 kB
Inactive(file):   466848 kB
Unevictable:           0 kB
Mlocked:               0 kB
SwapTotal:       2097148 kB
SwapFree:        2097148 kB
Dirty:               404 kB
Writeback:             0 kB
AnonPages:        342880 kB
Mapped:           253212 kB
Shmem:             14380 kB
KReclaimable:      65340 kB
Slab:             491344 kB
SReclaimable:      65340 kB
SUnreclaim:       426004 kB
KernelStack:       13984 kB
PageTables:        12200 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:     5973016 kB
Committed_AS:    3450184 kB
VmallocTotal:   34359738367 kB
VmallocUsed:       62028 kB
VmallocChunk:          0 kB
Percpu:            35840 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:      439756 kB
DirectMap2M:     4423680 kB
DirectMap1G:     5242880 kB

free -m 的输出:

               total        used        free      shared  buff/cache   available
Mem:            7570        6374         451          14         744         934
Swap:           2047           0        2047

输出ps aux | awk '{print $6/1024 " MB\t\t" $11}' | sort -n

.
.
.
17.1641 MB      /usr/libexec/gnome-session-binary
18.0469 MB      /usr/sbin/NetworkManager
20.0547 MB      /usr/libexec/packagekitd
20.5898 MB      /usr/libexec/gsd-keyboard
21.0039 MB      /usr/bin/python3
21.4297 MB      /usr/libexec/gsd-wacom
22.0117 MB      /usr/bin/pulseaudio
22.7617 MB      /usr/bin/python3
24.2656 MB      /usr/libexec/gsd-power
24.4805 MB      /usr/libexec/gsd-color
24.5625 MB      /usr/bin/pulseaudio
25.2344 MB      /usr/libexec/tracker-miner-fs-3
25.7227 MB      /usr/libexec/gsd-media-keys
26.9805 MB      /usr/bin/gjs
27.0859 MB      /usr/bin/gjs
30.0234 MB      /usr/libexec/tracker-extract-3
37.3438 MB      /usr/lib/snapd/snapd
38.2695 MB      /usr/libexec/goa-daemon
53.3516 MB      /lib/systemd/systemd-journald
86.5469 MB      /usr/bin/Xwayland
199.949 MB      /usr/bin/gnome-shell

输出df | grep tmpfs

tmpfs             775176     2396    772780   1% /run
tmpfs            3875868        0   3875868   0% /dev/shm
tmpfs               5120        4      5116   1% /run/lock
tmpfs             775172       76    775096   1% /run/user/127
tmpfs             775172       68    775104   1% /run/user/1001

相关内容