每当我进行密集的文件操作时,或者只是偶尔,我都会调用 OOMKiller 并杀死一些东西。然而,当发生这种情况时,我似乎有很多可用内存:
[nitz@saturn ~]$ free -h
total used free shared buff/cache available
Mem: 7.7Gi 123Mi 5.5Gi 0.0Ki 2.1Gi 7.5Gi
Swap: 2.0Gi 0B 2.0Gi
我尝试将我的工作负载(例如 Deluge)转移到 Docker,看起来它们甚至还没有达到极限:
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
e43658667cb1 docker-compose-rhasspy-1 10.06% 173.9MiB / 1GiB 16.98% 4.96kB / 222B 295MB / 16.4kB 36
50f77474bf8d docker-compose-caddy-1 0.05% 7.75MiB / 50MiB 15.50% 23.2kB / 31.8kB 39.1MB / 16.4kB 10
5a63ea5eb900 docker-compose-homeassistant-1 79.50% 73.24MiB / 1GiB 7.15% 31.6kB / 9.6kB 127MB / 1.43MB 20
c07d0922fb82 docker-compose-wireguard-1 0.22% 15.16MiB / 150MiB 10.11% 6.41kB / 164B 66.5MB / 434kB 17
836e97c7cbdc docker-compose-zwavejs-1 1.73% 68.68MiB / 150MiB 45.79% 5.37kB / 0B 129MB / 8.19kB 11
e2abf6de1673 docker-compose-deluge-1 33.04% 104.7MiB / 4GiB 2.56% 50.8MB / 1.35MB 84.2MB / 8.34MB 12
我附加一些堆栈跟踪OOMKiller,以防它表明出了什么问题。
也许相关摘录:
[ 571.399130] Node 0 active_anon:772kB inactive_anon:69068kB active_file:537768kB inactive_file:1464348kB unevictable:0kB isolated(anon):0kB isolated(file):8kB mapped:125152kB dirty:4036kB writeback:80kB shmem:1048kB writeback_tmp:0kB kernel_stack:2684kB pagetables:3812kB sec_pagetables:0kB all_unreclaimable? no
[ 571.399155] DMA free:522564kB boost:0kB min:3140kB low:3924kB high:4708kB reserved_highatomic:4096KB active_anon:0kB inactive_anon:0kB active_file:272kB inactive_file:408kB unevictable:0kB writepending:0kB present:786432kB managed:626980kB mlocked:0kB bounce:0kB free_pcp:172kB local_pcp:128kB free_cma:516536kB
[ 571.399181] lowmem_reserve[]: 0 0 7283 7283
[ 571.399203] DMA: 394*4kB (UEH) 150*8kB (UEHC) 105*16kB (UEHC) 47*32kB (UEHC) 5*64kB (HC) 4*128kB (HC) 3*256kB (C) 4*512kB (C) 3*1024kB (C) 3*2048kB (C) 123*4096kB (C) = 522632kB
[ 571.399284] 500804 total pagecache pages
[ 571.399292] 0 pages in swap cache
[ 571.399300] Free swap = 2097148kB
[ 571.399306] Total swap = 2097148kB
[ 571.399313] 2061056 pages RAM
[ 571.399320] 1864448 pages HighMem/MovableOnly
[ 571.399326] 39863 pages reserved
[ 571.399336] 131072 pages cma reserved
到底是怎么回事?这是我用完的一些特定于内核的内存吗?
我尝试过的事情:
- 分配交换空间:似乎未使用
- 将 Deluge 移至 Docker,对总和低于 rPi RAM 总量 (7.7Gi) 的所有 Docker 设置显式内存限制
- 搜索 OOMKiller 日志。
眼镜:rPi 4,Arch Linux for ARM (ALARM),定期更新。
更多垃圾场
/etc/systemd/system.conf
- 没有
/etc/systemd/system.conf.d/*.conf
文件。 /etc/systemd/system/docker-compose.service
。