3

I'd like to see which systemd services consume the most amount of memory.

Is there a way to list all running (and/or enabled) systemd services by memory usage?

Newskooler
  • 211
  • 1
  • 3
  • 14

1 Answers1

6

Enable memory accounting by creating /etc/systemd/system.conf.d/accounting.conf containing

[Manager]
#DefaultCPUAccounting=yes
#DefaultBlockIOAccounting=yes
DefaultMemoryAccounting=yes
#DefaultTasksAccounting=yes

Reload after config change.

systemctl daemon-reload

Watch units (cgroups) by memory size.

systemd-cgtop -m
John Mahowald
  • 32,050
  • 2
  • 19
  • 34