after the program finishes execution, it calls exit()
this system call:
-takes the result (return value) of the process as an argument
-closes all open files, connections, etc.
-deallocates memory
-deallocates most of the OS structures supporting the process
-Checks if parent is alive:
--if so, it holds the result value until parent requests it; in this case, process does not really die, but it enters the zombie/defunct state
--if not, it deallocates all data structures, the process is dead
-cleans up all waiting zombies
Process termination is the ultimate garbage collection (resources reclamation)