Interview Prep/Linux/Processes, memory and OOM

After a deploy, a process uses far more memory than before, with high `VSZ` but normal `RSS`. Should you worry?

BeginnerTroubleshootingProcesses, memory and OOM
Answer

Likely causes → VSZ counts reserved virtual address space (thread stacks, mmap'd files, allocator arenas), not real memory use.

Diagnose →

ps -o pid,vsz,rss,cmd -p <PID>
sudo pmap -x <PID> | tail -5
grep -E 'VmRSS|RssAnon|RssFile' /proc/<PID>/status

Fix → Nothing, if RSS and PSS are stable. glibc arenas can inflate VSZ; MALLOC_ARENA_MAX=2 reduces it for many-threaded apps if needed.

Prevent → Monitor RSS/PSS and cgroup memory.current, not VSZ.

All Linux questions Roadmap: Linux

More on Processes, memory and OOM