Interview Prep/Linux/Processes, memory and OOM

A process consumes a lot of CPU in `sy` (system) time instead of `us` (user).

AdvancedTroubleshootingProcesses, memory and OOM
Answer

Likely causes → Too many syscalls (tiny reads/writes, busy polling), lock contention, page faults, or heavy context switching.

Diagnose →

pidstat -u -w -p <PID> 1 5          # %system, cswch/s
sudo strace -c -f -p <PID>          # syscall counts for a few seconds
sudo perf top -p <PID>

Fix → Depends on findings: bigger buffers, fewer threads, use epoll instead of polling loops, fix spin locks. Report the hot syscalls to devs.

Prevent → Profile under load in staging; watch %sys in dashboards.

All Linux questions Roadmap: Linux

More on Processes, memory and OOM