"apt-show-versions -i" takes too much memory and is killed by oom-killer
on my machine. From journalctl output:
Oct 26 01:03:10 joooj kernel: apt-show-versio invoked oom-killer: gfp_mask=0x6200ca(GFP_HIGHUSER_MOVABLE), nodemask=(null), order=0, oom_score_adj=0
Oct 26 01:03:10 joooj kernel: apt-show-versio cpuset=/ mems_allowed=0
Oct 26 01:03:10 joooj kernel: CPU: 0 PID: 15598 Comm: apt-show-versio Not tainted 4.19.0-6-amd64 #1 Debian 4.19.67-2+deb10u1
Oct 26 01:03:10 joooj kernel: Call Trace:
Oct 26 01:03:10 joooj kernel: dump_stack+0x5c/0x80
Oct 26 01:03:10 joooj kernel: dump_header+0x6b/0x283
Oct 26 01:03:10 joooj kernel: oom_kill_process.cold.30+0xb/0x1cf
Oct 26 01:03:10 joooj kernel: ? oom_badness+0xe9/0x140
Oct 26 01:03:10 joooj kernel: out_of_memory+0x1a5/0x430
Oct 26 01:03:10 joooj kernel: __alloc_pages_slowpath+0xbd8/0xcb0
Oct 26 01:03:10 joooj kernel: ? __switch_to_asm+0x41/0x70
Oct 26 01:03:10 joooj kernel: __alloc_pages_nodemask+0x28b/0x2b0
Oct 26 01:03:10 joooj kernel: alloc_pages_vma+0x74/0x1c0
Oct 26 01:03:10 joooj kernel: __read_swap_cache_async+0x14c/0x200
Oct 26 01:03:10 joooj kernel: read_swap_cache_async+0x28/0x60
Oct 26 01:03:10 joooj kernel: swapin_readahead+0x325/0x4c0
Oct 26 01:03:10 joooj kernel: ? radix_tree_lookup_slot+0x1e/0x50
Oct 26 01:03:10 joooj kernel: ? find_get_entry+0x19/0xf0
Oct 26 01:03:10 joooj kernel: ? pagecache_get_page+0x30/0x2c0
Oct 26 01:03:10 joooj kernel: do_swap_page+0x44b/0x960
Oct 26 01:03:10 joooj kernel: ? __raw_callee_save_xen_pmd_val+0x11/0x1e
Oct 26 01:03:10 joooj kernel: __handle_mm_fault+0x876/0x1270
Oct 26 01:03:10 joooj kernel: handle_mm_fault+0xd6/0x200
Oct 26 01:03:10 joooj kernel: __do_page_fault+0x249/0x4f0
Oct 26 01:03:10 joooj kernel: ? page_fault+0x8/0x30
Oct 26 01:03:10 joooj kernel: page_fault+0x1e/0x30
Oct 26 01:03:10 joooj kernel: RIP: e033:0x55843f28d9ab
Oct 26 01:03:10 joooj kernel: Code: 4b 8d 0c ce 48 8b b1 60 08 00 00 48 89 32 48 89 91 60 08 00 00 48 39 eb 74 0b 8b 53 08 85 d2 0f 84 0c 02 00 00 48 85 c0 74 17 <8b> 50 08 85 d2 0f 84 1a 06 00 00 83 ea 01 89 50 08 0f 84 16 ff ff
Oct 26 01:03:10 joooj kernel: RSP: e02b:00007ffffee355c0 EFLAGS: 00010202
Oct 26 01:03:10 joooj kernel: RAX: 0000558445106458 RBX: 0000558444ffb330 RCX: 000055843f344cc8
Oct 26 01:03:10 joooj kernel: RDX: 000055844546e2b0 RSI: 0000000000000800 RDI: 000055843f344cc0
Oct 26 01:03:10 joooj kernel: RBP: 0000558447c95678 R08: 0000000000000000 R09: 000000000000000c
Oct 26 01:03:10 joooj kernel: R10: 0000000000000007 R11: 00005584408f03b0 R12: 000055843f343ae0
Oct 26 01:03:10 joooj kernel: R13: 0000000000000001 R14: 00005584408e7260 R15: 000055844546e280
Oct 26 01:03:10 joooj kernel: Mem-Info:
Oct 26 01:03:10 joooj kernel: active_anon:10619 inactive_anon:10681 isolated_anon:0
active_file:180 inactive_file:301 isolated_file:0
unevictable:2634 dirty:0 writeback:0 unstable:0
slab_reclaimable:59427 slab_unreclaimable:17738
mapped:1358 shmem:1 pagetables:1207 bounce:0
free:1052 free_pcp:144 free_cma:0
Oct 26 01:03:10 joooj kernel: Node 0 active_anon:42476kB inactive_anon:42724kB active_file:720kB inactive_file:1204kB unevictable:10536kB isolated(anon):0kB isolated(file):0kB mapped:5432kB dirty:0kB writeback:0kB shmem:4kB shmem_thp: 0kB shmem_pmdmapped: 0kB anon_thp: 0kB writeback_tmp:0kB unstable:0kB all_unreclaimable? no
Oct 26 01:03:10 joooj kernel: Node 0 DMA free:1812kB min:92kB low:112kB high:132kB active_anon:1132kB inactive_anon:1420kB active_file:4kB inactive_file:24kB unevictable:0kB writepending:0kB present:15996kB managed:15912kB mlocked:0kB kernel_stack:0kB pagetables:32kB bounce:0kB free_pcp:0kB local_pcp:0kB free_cma:0kB
Oct 26 01:03:10 joooj kernel: lowmem_reserve[]: 0 434 434 434 434
Oct 26 01:03:10 joooj kernel: Node 0 DMA32 free:2396kB min:2616kB low:3268kB high:3920kB active_anon:41088kB inactive_anon:41552kB active_file:604kB inactive_file:1100kB unevictable:10536kB writepending:0kB present:507904kB managed:473348kB mlocked:10536kB kernel_stack:4384kB pagetables:4796kB bounce:0kB free_pcp:576kB local_pcp:576kB free_cma:0kB
Oct 26 01:03:10 joooj kernel: lowmem_reserve[]: 0 0 0 0 0
Oct 26 01:03:10 joooj kernel: Node 0 DMA: 16*4kB (UEH) 19*8kB (UH) 16*16kB (UE) 22*32kB (UEH) 8*64kB (H) 1*128kB (H) 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 1816kB
Oct 26 01:03:10 joooj kernel: Node 0 DMA32: 110*4kB (UME) 110*8kB (UE) 70*16kB (UE) 8*32kB (U) 0*64kB 0*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 2696kB
Oct 26 01:03:10 joooj kernel: 1677 total pagecache pages
Oct 26 01:03:10 joooj kernel: 110 pages in swap cache
Oct 26 01:03:10 joooj kernel: Swap cache stats: add 16616845, delete 16616735, find 9813553/15811820
Oct 26 01:03:10 joooj kernel: Free swap = 0kB
Oct 26 01:03:10 joooj kernel: Total swap = 360376kB
Oct 26 01:03:10 joooj kernel: 130975 pages RAM
Oct 26 01:03:10 joooj kernel: 0 pages HighMem/MovableOnly
Oct 26 01:03:10 joooj kernel: 8660 pages reserved
Oct 26 01:03:10 joooj kernel: 0 pages hwpoisoned
Oct 26 01:03:10 joooj kernel: Tasks state (memory values in pages):
Oct 26 01:03:10 joooj kernel: [ pid ] uid tgid total_vm rss pgtables_bytes swapents oom_score_adj name
Oct 26 01:03:10 joooj kernel: [ 306] 0 306 31236 449 253952 4129 0 systemd-journal
Oct 26 01:03:10 joooj kernel: [ 321] 0 321 5481 310 73728 240 -1000 systemd-udevd
Oct 26 01:03:10 joooj kernel: [ 371] 103 371 23270 485 90112 235 0 systemd-timesyn
Oct 26 01:03:10 joooj kernel: [ 378] 0 378 56456 189 86016 497 0 rsyslogd
Oct 26 01:03:10 joooj kernel: [ 380] 0 380 581 159 45056 36 0 acpid
Oct 26 01:03:10 joooj kernel: [ 388] 0 388 571 337 45056 49 0 atopacctd
Oct 26 01:03:10 joooj kernel: [ 389] 0 389 2638 408 53248 95 0 cron
Oct 26 01:03:10 joooj kernel: [ 394] 101 394 2343 200 53248 242 -900 dbus-daemon
Oct 26 01:03:10 joooj kernel: [ 648] 0 648 78534 362 98304 256 0 automount
Oct 26 01:03:10 joooj kernel: [ 653] 0 653 101733 655 155648 4365 0 fail2ban-server
Oct 26 01:03:10 joooj kernel: [ 655] 0 655 1865 333 53248 34 0 agetty
Oct 26 01:03:10 joooj kernel: [ 658] 0 658 1484 298 49152 32 0 agetty
Oct 26 01:03:10 joooj kernel: [ 743] 1000 743 5288 467 77824 347 0 systemd
Oct 26 01:03:10 joooj kernel: [ 744] 1000 744 5820 0 81920 585 0 (sd-pam)
Oct 26 01:03:10 joooj kernel: [ 1098] 1000 1098 1465 161 57344 155 0 ssh-agent
Oct 26 01:03:10 joooj kernel: [ 1398] 0 1398 10869 434 77824 234 0 master
Oct 26 01:03:10 joooj kernel: [ 4152] 1000 4152 4878 276 73728 2774 0 screen
Oct 26 01:03:10 joooj kernel: [ 4153] 1000 4153 12392 551 118784 5636 0 mutt
Oct 26 01:03:10 joooj kernel: [ 4169] 1000 4169 2955 522 61440 684 0 zsh
Oct 26 01:03:10 joooj kernel: [ 19508] 1000 19508 3777 546 69632 827 0 zsh
Oct 26 01:03:10 joooj kernel: [ 6495] 0 6495 4622 249 73728 253 0 saslauthd
Oct 26 01:03:10 joooj kernel: [ 6496] 0 6496 4622 248 73728 244 0 saslauthd
Oct 26 01:03:10 joooj kernel: [ 6497] 0 6497 4622 276 73728 251 0 saslauthd
Oct 26 01:03:10 joooj kernel: [ 6498] 0 6498 4622 169 73728 241 0 saslauthd
Oct 26 01:03:10 joooj kernel: [ 6499] 0 6499 4622 294 73728 237 0 saslauthd
Oct 26 01:03:10 joooj kernel: [ 10433] 1000 10433 6391 478 86016 442 0 mosh-server
Oct 26 01:03:10 joooj kernel: [ 10434] 1000 10434 3821 545 65536 808 0 zsh
Oct 26 01:03:10 joooj kernel: [ 5128] 1000 5128 3816 526 65536 863 0 zsh
Oct 26 01:03:10 joooj kernel: [ 31418] 0 31418 3960 373 65536 231 -1000 sshd
Oct 26 01:03:10 joooj kernel: [ 28350] 1000 28350 6387 479 86016 438 0 mosh-server
Oct 26 01:03:10 joooj kernel: [ 28351] 1000 28351 2950 524 65536 679 0 zsh
Oct 26 01:03:10 joooj kernel: [ 7224] 0 7224 3343 402 65536 484 0 apache2
Oct 26 01:03:10 joooj kernel: [ 11345] 1000 11345 3764 557 65536 779 0 zsh
Oct 26 01:03:10 joooj kernel: [ 19242] 0 19242 4239 469 73728 284 0 sshd
Oct 26 01:03:10 joooj kernel: [ 19249] 1000 19249 4239 307 73728 287 0 sshd
Oct 26 01:03:10 joooj kernel: [ 19250] 1000 19250 4144 746 77824 589 0 zsh
Oct 26 01:03:10 joooj kernel: [ 2489] 1000 2489 4037 373 65536 209 0 ssh
Oct 26 01:03:10 joooj kernel: [ 31163] 1000 31163 6256 482 77824 296 0 mosh-server
Oct 26 01:03:10 joooj kernel: [ 31164] 1000 31164 2950 557 73728 681 0 zsh
Oct 26 01:03:10 joooj kernel: [ 31277] 1000 31277 1432 28 45056 24 0 cat
Oct 26 01:03:10 joooj kernel: [ 544] 0 544 26955 899 258048 21234 0 spamd
Oct 26 01:03:10 joooj kernel: [ 7957] 107 7957 10986 497 77824 244 0 qmgr
Oct 26 01:03:10 joooj kernel: [ 8109] 107 8109 11002 530 73728 240 0 tlsmgr
Oct 26 01:03:10 joooj kernel: [ 9955] 0 9955 28751 578 274432 23244 0 spamd child
Oct 26 01:03:10 joooj kernel: [ 10376] 0 10376 4874 291 77824 258 0 systemd-logind
Oct 26 01:03:10 joooj kernel: [ 12643] 1000 12643 6440 497 81920 468 0 mosh-server
Oct 26 01:03:10 joooj kernel: [ 12644] 1000 12644 2951 549 65536 690 0 zsh
Oct 26 01:03:10 joooj kernel: [ 13461] 0 13461 26955 303 258048 21511 0 spamd child
Oct 26 01:03:10 joooj kernel: [ 13495] 107 13495 10956 460 73728 238 0 pickup
Oct 26 01:03:10 joooj kernel: [ 13510] 0 13510 3296 2636 69632 0 0 atop
Oct 26 01:03:10 joooj kernel: [ 13550] 33 13550 3279 319 65536 488 0 apache2
Oct 26 01:03:10 joooj kernel: [ 13551] 33 13551 190742 0 217088 2139 0 apache2
Oct 26 01:03:10 joooj kernel: [ 13552] 33 13552 190423 0 217088 1784 0 apache2
Oct 26 01:03:10 joooj kernel: [ 14622] 0 14622 4239 469 69632 283 0 sshd
Oct 26 01:03:11 joooj kernel: [ 14629] 1000 14629 4239 335 69632 302 0 sshd
Oct 26 01:03:11 joooj kernel: [ 14630] 1000 14630 3383 526 61440 694 0 zsh
Oct 26 01:03:11 joooj kernel: [ 15598] 1000 15598 55835 19950 491520 22569 0 apt-show-versio
Oct 26 01:03:11 joooj kernel: [ 15633] 107 15633 11014 468 81920 253 0 postscreen
Oct 26 01:03:11 joooj kernel: [ 15634] 107 15634 10965 444 69632 218 0 dnsblog
Oct 26 01:03:11 joooj kernel: [ 15635] 107 15635 10965 447 77824 218 0 dnsblog
Oct 26 01:03:11 joooj kernel: [ 15636] 1000 15636 67079 710 401408 89 0 journalctl
Oct 26 01:03:11 joooj kernel: [ 15637] 1000 15637 2597 1021 61440 385 0 less
Oct 26 01:03:11 joooj kernel: Out of memory: Kill process 15598 (apt-show-versio) score 200 or sacrifice child
Oct 26 01:03:11 joooj kernel: Killed process 15598 (apt-show-versio) total-vm:223340kB, anon-rss:77648kB, file-rss:2152kB, shmem-rss:0kB
Oct 26 01:03:11 joooj kernel: oom_reaper: reaped process 15598 (apt-show-versio), now anon-rss:0kB, file-rss:0kB, shmem-rss:0kB
Note that it is invoked after "apt-get update"
(/etc/apt/apt.conf.d/20apt-show-versions).