I'm trying to do a compile Zed from source in cargo with the release flag. I'm on the last step, linking it all together and that uses a fair amount of RAM. Cargo / RustC is using 7.2GB in a single process and that's invoking the OOMK, but I still have another 7GB of system memory free. Is there a way to make OOMK less aggressive?
DMESG Logs:You can see that rustc has total-vm = 11.093456GB, anon-rss = 6.75888GB, file-rss: 94 MB. Yeah a lot of memory, but it still has another 4GB to go. But it looks like there is another problem. It looks like it ran out of reclaimable memory in several zones/nodes at once and it just couldn't get that sorted out in time so the OOMK shot rustc with it being the biggest memory hog.
Is there anything that can be done to tweak this? I'd like to be able to use up to 14GB of RAM on a single thread without the OOMK getting trigger happy.
DMESG Logs:
Code:
[11329.882223] kswapd0 invoked oom-killer: gfp_mask=0xcc0(GFP_KERNEL), order=0, oom_score_adj=0[11329.882264] CPU: 3 UID: 0 PID: 70 Comm: kswapd0 Not tainted 6.12.47+rpt-rpi-2712 #1 Debian 1:6.12.47-1+rpt1[11329.882273] Hardware name: Raspberry Pi 500 Rev 1.0 (DT)[11329.882275] Call trace:[11329.882277] dump_backtrace.part.0+0xe0/0x100[11329.882303] show_stack+0x20/0x40[11329.882308] dump_stack_lvl+0x60/0x80[11329.882320] dump_stack+0x18/0x28[11329.882323] dump_header+0x48/0x178[11329.882327] oom_kill_process+0x29c/0x320[11329.882335] out_of_memory+0xf4/0x5b0[11329.882338] balance_pgdat+0x554/0x958[11329.882347] kswapd+0x248/0x500[11329.882350] kthread+0x118/0x128[11329.882353] ret_from_fork+0x10/0x20[11329.882358] Mem-Info:[11329.882372] active_anon:374863 inactive_anon:78745 isolated_anon:0 active_file:206926 inactive_file:239916 isolated_file:0 unevictable:2790 dirty:5986 writeback:0 slab_reclaimable:23024 slab_unreclaimable:4001 mapped:20009 shmem:4148 pagetables:1227 sec_pagetables:0 bounce:0 kernel_misc_reclaimable:0 free:81653 free_pcp:8420 free_cma:697[11329.882385] Node 0 active_anon:240992kB inactive_anon:1059840kB active_file:7856kB inactive_file:27776kB unevictable:5632kB isolated(anon):0kB isolated(file):0kB mapped:6832kB dirty:27776kB writeback:0kB shmem:7024kB writeback_tmp:0kB kernel_stack:1616kB pagetables:3168kB sec_pagetables:0kB all_unreclaimable? no[11329.882391] Node 1 active_anon:1196000kB inactive_anon:18592kB active_file:56384kB inactive_file:235424kB unevictable:5664kB isolated(anon):0kB isolated(file):0kB mapped:34096kB dirty:11920kB writeback:0kB shmem:7152kB writeback_tmp:0kB kernel_stack:864kB pagetables:3136kB sec_pagetables:0kB all_unreclaimable? no[11329.882397] Node 2 active_anon:906896kB inactive_anon:4976kB active_file:389456kB inactive_file:209152kB unevictable:5584kB isolated(anon):0kB isolated(file):0kB mapped:22496kB dirty:11904kB writeback:0kB shmem:6928kB writeback_tmp:0kB kernel_stack:1120kB pagetables:2448kB sec_pagetables:0kB all_unreclaimable? no[11329.882401] Node 3 active_anon:453792kB inactive_anon:40832kB active_file:710720kB inactive_file:812880kB unevictable:5552kB isolated(anon):0kB isolated(file):0kB mapped:58528kB dirty:16kB writeback:0kB shmem:9568kB writeback_tmp:0kB kernel_stack:432kB pagetables:2032kB sec_pagetables:0kB all_unreclaimable? no[11329.882405] Node 4 active_anon:538000kB inactive_anon:73072kB active_file:514432kB inactive_file:892160kB unevictable:5504kB isolated(anon):0kB isolated(file):0kB mapped:58384kB dirty:0kB writeback:0kB shmem:9552kB writeback_tmp:0kB kernel_stack:1328kB pagetables:2016kB sec_pagetables:0kB all_unreclaimable? no[11329.882410] Node 5 active_anon:514224kB inactive_anon:20448kB active_file:716912kB inactive_file:766464kB unevictable:5504kB isolated(anon):0kB isolated(file):0kB mapped:58448kB dirty:16kB writeback:0kB shmem:9520kB writeback_tmp:0kB kernel_stack:272kB pagetables:1952kB sec_pagetables:0kB all_unreclaimable? no[11329.882413] Node 6 active_anon:1513664kB inactive_anon:12352kB active_file:233232kB inactive_file:232544kB unevictable:5568kB isolated(anon):0kB isolated(file):0kB mapped:18624kB dirty:44144kB writeback:0kB shmem:6912kB writeback_tmp:0kB kernel_stack:672kB pagetables:2624kB sec_pagetables:0kB all_unreclaimable? no[11329.882418] Node 7 active_anon:634240kB inactive_anon:29808kB active_file:681824kB inactive_file:662256kB unevictable:5632kB isolated(anon):0kB isolated(file):0kB mapped:62736kB dirty:0kB writeback:0kB shmem:9712kB writeback_tmp:0kB kernel_stack:560kB pagetables:2256kB sec_pagetables:0kB all_unreclaimable? no[11329.882421] Node 0 DMA free:524672kB boost:32768kB min:34784kB low:36832kB high:38880kB reserved_highatomic:0KB active_anon:240880kB inactive_anon:1059888kB active_file:7856kB inactive_file:27824kB unevictable:5632kB writepending:27824kB present:2088960kB managed:2056464kB mlocked:0kB bounce:0kB free_pcp:16048kB local_pcp:656kB free_cma:11152kB[11329.882430] lowmem_reserve[]: 0 0 0 0[11329.882436] Node 1 DMA free:336144kB boost:0kB min:1984kB low:4000kB high:6016kB reserved_highatomic:0KB active_anon:1196000kB inactive_anon:18592kB active_file:56384kB inactive_file:235424kB unevictable:5664kB writepending:11920kB present:2097152kB managed:2023408kB mlocked:16kB bounce:0kB free_pcp:54784kB local_pcp:9776kB free_cma:0kB[11329.882442] lowmem_reserve[]: 0 0 0 0[11329.882447] Node 2 Normal free:429920kB boost:0kB min:2048kB low:4128kB high:6208kB reserved_highatomic:0KB active_anon:906896kB inactive_anon:4976kB active_file:389456kB inactive_file:209152kB unevictable:5584kB writepending:11904kB present:2097152kB managed:2088944kB mlocked:0kB bounce:0kB free_pcp:54112kB local_pcp:976kB free_cma:0kB[11329.882452] lowmem_reserve[]: 0 0 0 0[11329.882456] Node 3 Normal free:3824kB boost:0kB min:2048kB low:4128kB high:6208kB reserved_highatomic:0KB active_anon:453792kB inactive_anon:40832kB active_file:710720kB inactive_file:812880kB unevictable:5552kB writepending:16kB present:2097152kB managed:2088944kB mlocked:0kB bounce:0kB free_pcp:800kB local_pcp:0kB free_cma:0kB[11329.882462] lowmem_reserve[]: 0 0 0 0[11329.882467] Node 4 Normal free:3632kB boost:0kB min:2048kB low:4128kB high:6208kB reserved_highatomic:0KB active_anon:538000kB inactive_anon:73072kB active_file:514432kB inactive_file:892160kB unevictable:5504kB writepending:0kB present:2097152kB managed:2088928kB mlocked:0kB bounce:0kB free_pcp:752kB local_pcp:0kB free_cma:0kB[11329.882475] lowmem_reserve[]: 0 0 0 0[11329.882480] Node 5 Normal free:4128kB boost:0kB min:2048kB low:4128kB high:6208kB reserved_highatomic:0KB active_anon:514224kB inactive_anon:20448kB active_file:716912kB inactive_file:766464kB unevictable:5504kB writepending:16kB present:2097152kB managed:2088944kB mlocked:0kB bounce:0kB free_pcp:176kB local_pcp:0kB free_cma:0kB[11329.882485] lowmem_reserve[]: 0 0 0 0[11329.882490] Node 6 Normal free:240kB boost:0kB min:2048kB low:4128kB high:6208kB reserved_highatomic:0KB active_anon:1513664kB inactive_anon:12352kB active_file:233232kB inactive_file:232544kB unevictable:5568kB writepending:44144kB present:2097152kB managed:2088944kB mlocked:0kB bounce:0kB free_pcp:7072kB local_pcp:304kB free_cma:0kB[11329.882495] lowmem_reserve[]: 0 0 0 0[11329.882499] Node 7 Normal free:3888kB boost:0kB min:2048kB low:4112kB high:6176kB reserved_highatomic:0KB active_anon:634240kB inactive_anon:29808kB active_file:681824kB inactive_file:662256kB unevictable:5632kB writepending:0kB present:2097152kB managed:2079568kB mlocked:0kB bounce:0kB free_pcp:896kB local_pcp:0kB free_cma:0kB[11329.882503] lowmem_reserve[]: 0 0 0 0[11329.882508] Node 0 DMA: 4260*16kB (MC) 4394*32kB (UMC) 2703*64kB (UMC) 957*128kB (UMC) 76*256kB (UMC) 1*512kB (M) 0*1024kB 0*2048kB 0*4096kB 0*8192kB 0*16384kB 0*32768kB = 524224kB[11329.882527] Node 1 DMA: 1331*16kB (UM) 936*32kB (UME) 327*64kB (UM) 95*128kB (UM) 24*256kB (UME) 4*512kB (UM) 8*1024kB (ME) 7*2048kB (ME) 2*4096kB (M) 4*8192kB (ME) 3*16384kB (ME) 4*32768kB (M) = 336240kB[11329.882550] Node 2 Normal: 1166*16kB (UME) 391*32kB (UME) 141*64kB (UME) 51*128kB (UME) 13*256kB (UME) 2*512kB (M) 4*1024kB (ME) 1*2048kB (M) 1*4096kB (M) 1*8192kB (M) 4*16384kB (M) 9*32768kB (UM) = 429952kB[11329.882575] Node 3 Normal: 17*16kB (UE) 3*32kB (UE) 4*64kB (U) 23*128kB (UE) 2*256kB (U) 0*512kB 0*1024kB 0*2048kB 0*4096kB 0*8192kB 0*16384kB 0*32768kB = 4080kB[11329.882594] Node 4 Normal: 1*16kB (U) 69*32kB (U) 14*64kB (U) 2*128kB (U) 1*256kB (U) 0*512kB 0*1024kB 0*2048kB 0*4096kB 0*8192kB 0*16384kB 0*32768kB = 3632kB[11329.882613] Node 5 Normal: 10*16kB (UME) 14*32kB (U) 15*64kB (U) 14*128kB (UE) 3*256kB (U) 0*512kB 0*1024kB 0*2048kB 0*4096kB 0*8192kB 0*16384kB 0*32768kB = 4128kB[11329.882630] Node 6 Normal: 0*16kB 0*32kB 0*64kB 0*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB 0*8192kB 0*16384kB 0*32768kB = 0kB[11329.882644] Node 7 Normal: 1*16kB (E) 7*32kB (UE) 7*64kB (U) 19*128kB (UE) 3*256kB (U) 0*512kB 0*1024kB 0*2048kB 0*4096kB 0*8192kB 0*16384kB 0*32768kB = 3888kB[11329.882661] 450989 total pagecache pages[11329.882664] 13 pages in swap cache[11329.882666] Free swap = 1653056kB[11329.882668] Total swap = 2097136kB[11329.882669] 1048064 pages RAM[11329.882670] 0 pages HighMem/MovableOnly[11329.882671] 10305 pages reserved[11329.882673] 4096 pages cma reserved[11329.882675] Tasks state (memory values in pages):[11329.882676] [ pid ] uid tgid total_vm rss rss_anon rss_file rss_shmem pgtables_bytes swapents oom_score_adj name[11329.882746] [ 341] 0 341 1693 589 96 333 160 114688 0 -250 systemd-journal[11329.882753] [ 390] 991 390 5785 429 96 333 0 114688 0 0 systemd-timesyn[11329.882760] [ 398] 0 398 2292 558 192 366 0 114688 64 -1000 systemd-udevd[11329.882764] [ 696] 102 696 441 136 0 136 0 98304 0 0 rpcbind[11329.882768] [ 708] 0 708 323 67 0 67 0 114688 0 0 blkmapd[11329.882772] [ 743] 0 743 19398 427 64 363 0 180224 0 0 accounts-daemon[11329.882775] [ 745] 101 745 403 197 32 165 0 98304 0 0 avahi-daemon[11329.882780] [ 746] 0 746 831 366 64 302 0 114688 0 0 bluetoothd[11329.882785] [ 747] 0 747 447 136 0 136 0 98304 0 0 cron[11329.882788] [ 750] 990 750 622 363 160 203 0 98304 32 -900 dbus-daemon[11329.882792] [ 752] 101 752 366 66 0 66 0 98304 0 0 avahi-daemon[11329.882795] [ 754] 988 754 23962 486 123 363 0 212992 64 0 polkitd[11329.882800] [ 769] 0 769 1200 491 96 395 0 98304 0 0 systemd-logind[11329.882805] [ 776] 0 776 25590 721 192 529 0 212992 32 0 udisksd[11329.882809] [ 826] 0 826 21412 830 192 638 0 196608 32 0 NetworkManager[11329.882813] [ 827] 0 827 1104 267 64 203 0 131072 0 0 wpa_supplicant[11329.882817] [ 882] 0 882 24952 657 224 433 0 212992 32 0 ModemManager[11329.882821] [ 1006] 0 1006 1424 435 160 275 0 98304 0 0 cupsd[11329.882826] [ 1015] 0 1015 23884 428 64 364 0 196608 0 0 lightdm[11329.882832] [ 1021] 0 1021 720 397 64 333 0 98304 0 -1000 sshd[11329.882836] [ 1024] 7 1024 1043 298 64 234 0 98304 0 0 dbus[11329.882839] [ 1025] 7 1025 1043 305 64 241 0 114688 0 0 dbus[11329.882843] [ 1033] 0 1033 10816 502 96 406 0 147456 0 0 lightdm[11329.882846] [ 1034] 0 1034 596 265 64 201 0 98304 0 0 login[11329.882850] [ 1035] 0 1035 466 135 0 135 0 114688 0 0 agetty[11329.882855] [ 1043] 1000 1043 1484 615 160 455 0 114688 32 100 systemd[11329.882859] [ 1045] 1000 1045 1525 285 152 133 0 98304 0 100 (sd-pam)[11329.882865] [ 1065] 1000 1065 540 258 64 194 0 98304 0 200 dbus-daemon[11329.882869] [ 1066] 1000 1066 32793 4338 1184 2419 735 311296 672 0 labwc[11329.882875] [ 1067] 1000 1067 7136 588 256 332 0 131072 96 200 pipewire[11329.882879] [ 1072] 1000 1072 5344 266 64 202 0 114688 0 200 pipewire[11329.882883] [ 1073] 1000 1073 52728 1430 565 865 0 376832 256 200 wireplumber[11329.882889] [ 1074] 1000 1074 6337 458 128 330 0 131072 0 200 pipewire-pulse[11329.882893] [ 1081] 1000 1081 458 199 32 167 0 98304 0 200 mpris-proxy[11329.882897] [ 1129] 1000 1129 643 95 62 33 0 98304 0 0 ssh-agent[11329.882901] [ 1182] 1000 1182 155 69 0 69 0 98304 0 0 lwrespawn[11329.882906] [ 1183] 1000 1183 155 67 0 67 0 98304 0 0 lwrespawn[11329.882909] [ 1184] 1000 1184 169 68 0 68 0 98304 0 0 kanshi[11329.882913] [ 1218] 1000 1218 25900 1117 288 829 0 229376 96 0 polkit-mate-aut[11329.882917] [ 1225] 1000 1225 1161 358 64 294 0 114688 0 0 systemd-inhibit[11329.882920] [ 1235] 1000 1235 57357 2715 768 1947 0 376832 96 0 wf-panel-pi[11329.882926] [ 1236] 1000 1236 155 67 0 67 0 98304 0 0 pcmanfm-pi[11329.882930] [ 1237] 1000 1237 45746 2151 622 1241 288 327680 384 0 pcmanfm[11329.882935] [ 1239] 1000 1239 25876 1087 256 831 0 229376 96 0 gtk-nop[11329.882940] [ 1268] 1000 1268 19637 496 64 432 0 196608 0 200 gvfsd[11329.882943] [ 1278] 1000 1278 24987 394 32 362 0 212992 0 200 gvfsd-fuse[11329.882949] [ 1291] 1000 1291 35184 865 224 641 0 278528 64 200 xdg-desktop-por[11329.882953] [ 1302] 1000 1302 19374 368 32 336 0 196608 0 200 xdg-permission-[11329.882958] [ 1307] 1000 1307 34033 431 64 367 0 262144 0 200 xdg-document-po[11329.882963] [ 1313] 1000 1313 149 104 0 104 0 98304 0 200 fusermount3[11329.882966] [ 1318] 1000 1318 25942 1166 288 878 0 212992 64 200 xdg-desktop-por[11329.882971] [ 1329] 1000 1329 24597 691 160 531 0 196608 0 200 gvfs-udisks2-vo[11329.882974] [ 1332] 1000 1332 22057 1898 384 1514 0 229376 288 200 xdg-desktop-por[11329.882978] [ 1339] 1000 1339 19322 430 64 366 0 180224 0 200 gvfs-mtp-volume[11329.882983] [ 1345] 1000 1345 19306 367 32 335 0 196608 0 200 gvfs-goa-volume[11329.882986] [ 1350] 1000 1350 19409 429 64 365 0 180224 0 200 gvfs-gphoto2-vo[11329.882992] [ 1358] 1000 1358 24462 493 96 397 0 212992 0 200 gvfs-afc-volume[11329.882996] [ 1400] 1000 1400 33495 465 64 401 0 245760 0 200 gvfsd-trash[11329.883000] [ 1479] 0 1479 12249 737 160 577 0 163840 32 0 cups-browsed[11329.883005] [ 1494] 1000 1494 563 262 64 198 0 98304 64 0 bash[11329.883009] [ 1536] 1000 1536 34445 2556 704 1398 454 262144 64 0 x-terminal-emul[11329.883014] [ 1548] 1000 1548 571 291 96 195 0 114688 32 0 bash[11329.883017] [ 1621] 1000 1621 10386 329 32 297 0 147456 0 200 dconf-service[11329.883024] [ 6767] 1000 6767 19017 2875 928 1947 0 229376 704 0 Xwayland[11329.883027] [ 6768] 1000 6768 485 230 32 198 0 98304 0 0 xsettingsd[11329.883034] [ 6849] 1000 6849 2148964 11965 4049 7858 58 622592 1920 0 chromium[11329.883040] [ 6869] 1000 6869 2098077 229 32 197 0 114688 0 0 chrome_crashpad[11329.883043] [ 6873] 1000 6873 2097557 199 32 167 0 114688 0 0 chrome_crashpad[11329.883046] [ 6875] 1000 6875 2120008 2580 704 1876 0 294912 320 0 chromium[11329.883050] [ 6876] 1000 6876 2120017 2440 608 1832 0 294912 416 0 chromium[11329.883054] [ 6879] 1000 6879 2120017 858 628 230 0 278528 384 0 chromium[11329.883057] [ 6907] 1000 6907 2138817 6384 2507 3823 54 491520 2080 200 chromium[11329.883062] [ 6913] 1000 6913 2123196 4216 1016 3168 32 344064 384 200 chromium[11329.883066] [ 6924] 1000 6924 2123691 2216 769 1447 0 327680 416 200 chromium[11329.883069] [ 6967] 0 6967 20078 623 192 431 0 196608 0 0 upowerd[11329.883073] [ 6973] 1000 6973 19705 434 64 370 0 196608 0 200 gnome-keyring-d[11329.883078] [ 6977] 1000 6977 24859 505 64 441 0 212992 0 200 gnome-keyring-d[11329.883082] [ 32062] 0 32062 1373 719 160 559 0 114688 0 0 sshd-session[11329.883086] [ 32069] 1000 32069 1386 466 166 300 0 114688 0 0 sshd-session[11329.883090] [ 32070] 1000 32070 563 361 160 201 0 98304 0 0 bash[11329.883101] [ 40929] 1000 40929 22089 11561 10299 1262 0 229376 1440 0 cargo[11329.883105] [ 40943] 1000 40943 693341 428306 422430 5876 0 5406720 14528 0 rustc[11329.883111] [ 41118] 1000 41118 592 329 160 169 0 98304 0 0 htop[11329.883114] oom-kill:constraint=CONSTRAINT_NONE,nodemask=(null),cpuset=/,mems_allowed=0-7,global_oom,task_memcg=/,task=rustc,pid=40943,uid=1000[11329.883161] Out of memory: Killed process 40943 (rustc) total-vm:11093456kB, anon-rss:6758880kB, file-rss:94016kB, shmem-rss:0kB, UID:1000 pgtables:5280kB oom_score_adj:0Is there anything that can be done to tweak this? I'd like to be able to use up to 14GB of RAM on a single thread without the OOMK getting trigger happy.
Statistics: Posted by Dygear — Sun Oct 12, 2025 8:39 am