Interview Prep/Linux/Processes, memory and OOM

A process has been running for weeks and you need to know which config file and environment it started with.

BeginnerTroubleshootingProcesses, memory and OOM
Answer

Likely causes → Config may have changed on disk since start; you need the process's own view.

Diagnose →

tr '\0' ' ' < /proc/<PID>/cmdline; echo
sudo tr '\0' '\n' < /proc/<PID>/environ
sudo ls -l /proc/<PID>/cwd /proc/<PID>/exe
sudo ls -l /proc/<PID>/fd | grep -E '\.conf|\.yml'

Fix → Compare with the current files; if they differ, plan a reload/restart.

Prevent → Reload services after config changes via config management handlers.

All Linux questions Roadmap: Linux

More on Processes, memory and OOM