IntermediatePhone
2 min
Troubleshooting High Memory in Linux
LinuxTroubleshootingSystem Administration
Advertisement
Interview Question
A server reports high memory usage. What quick checks do you perform to identify the cause?
Key Points to Cover
- Use `free -m`, `top`/`htop` sorted by RES to find processes
- Check caches/buffers and `vmstat`/`sar` for trends
- Inspect OOM events and logs (`dmesg`, `/var/log/messages`)
Evaluation Rubric
Uses appropriate observation tools40% weight
Interprets cache vs real pressure30% weight
Mentions OOM and logs review30% weight
Hints
- 💡Remember Linux page cache can appear as “used”.
Common Pitfalls to Avoid
- ⚠️Misinterpreting high buffer/cache memory as a problem when it's just the kernel using available RAM for performance.
- ⚠️Not sorting `top`/`htop` output by `RES` (Resident Set Size) or `%MEM`, leading to incorrect identification of memory-hungry processes (e.g., focusing on `VIRT` which includes swapped-out memory).
- ⚠️Failing to check `dmesg` for Out-Of-Memory (OOM) killer events, which are critical indicators of severe memory pressure and kernel intervention.
- ⚠️Ignoring the `swap` usage when analyzing `free -m` or `vmstat` outputs, as high swap activity can signify insufficient RAM even if physical memory isn't 100% full.
- ⚠️Jumping to conclusions about a memory leak without observing trends over time using tools like `vmstat` or `sar`, or reviewing historical data.
Potential Follow-up Questions
- ❓How to find memory leaks?
- ❓What is swapiness and when to tune it?
Advertisement