Lesson 5: What is a Process? /proc and Memory Layout
A process is a program in execution — not the binary on disk, but its live instance with memory, file descriptors and state. At NVIDIA, every CUDA application is a process with its own GPU context. When a GPU hangs, ps aux | grep cuda finds the PID and /proc/<pid>/maps shows whether CUDA mapped VRAM
A process is like an employee performing a task: the binary file is a resume written on paper, but the process is the actual employee sitting at a desk, using a computer and communicating with others. /proc is the management board showing every employee and what they are doing.
- Process
- A running instance of a program. Each process gets a unique PID, separate address space, file descriptors and CPU state. Different processes do not share memory directly.
- PID (Process ID)
- A unique integer the kernel assigns to each process. PID 1 is always init/systemd. /proc/<pid>/ contains all information about a process.
- PPID (Parent Process ID)
- The PID of the parent process that created the current process. Every process is created by another process (except init). PPID=0 indicates the kernel created the process.
- Process State
- Current state of a process: R (Running/Runnable), S (Sleeping — waiting for I/O), D (Uninterruptible sleep — waiting for kernel), Z (Zombie — finished but parent didn't clean up), T (Stopped).
- /proc filesystem
- A virtual filesystem the kernel generates in memory. Each /proc/<pid>/ is a directory containing live information about a process: status, maps, fd, cmdline and more.