Pcornel
Linux · Linux Troubleshooting

High Memory Usage

Cheat sheet · https://pcornel.dk/topic.php?topic=2914

Back to the Topic

Answer

High memory usage means available memory is low, the system swaps, or the OOM killer stops processes.

Remember

Ignore cache — look at available. Identify the largest RSS processes and whether they grow. Limit services with MemoryMax=. Add swap only as a buffer, not a fix.

First checks

  • journalctl -b -p err — errors this boot
  • systemctl --failed — failed units
  • df -h; df -i — space and inodes
  • ss -tulpn — listening sockets
  • dmesg -T | tail — recent kernel messages

Commands

df -h -t tmpfs
systemctl show app -p MemoryMax

Verify in this order

processes allocate → available memory falls → swap → OOM kill

Where it usually breaks

First mismatch in persistent intent → provider/parser/generator → kernel/userspace runtime → dependency/security context → logs/counters → consumer-visible read-back; preserve identity/native diagnostic/pre-state before mutation.

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=2914

Confirmation

Confirm action

Continue?