Address Space and Process Control Block(PCB)
๐๐๐๐ซ๐๐ฌ๐ฌ ๐๐ฉ๐๐๐: Every process running on our systems has memory allocated for its address space. Which includes: || ๐๐ต๐ข๐ค๐ฌ โ ๐๐ข๐ฑ โ ๐๐ฆ๐ข๐ฑ โ ๐๐ข๐ต๐ข โ ๐๐ฆ๐น๐ต|| โข Stack: Contai...

Source: DEV Community
๐๐๐๐ซ๐๐ฌ๐ฌ ๐๐ฉ๐๐๐: Every process running on our systems has memory allocated for its address space. Which includes: || ๐๐ต๐ข๐ค๐ฌ โ ๐๐ข๐ฑ โ ๐๐ฆ๐ข๐ฑ โ ๐๐ข๐ต๐ข โ ๐๐ฆ๐น๐ต|| โข Stack: Contains function calls, return addresses, local variables etc. โข Gap: That's just the empty space kept for the dynamic memory to grow. โข Heap: Used for dynamic memory allocation like malloc(), calloc(). โข Data: For const, global and static variables. โข Text: The program code or program instructions. (Usually read-only) -These address spaces are separate for each process and they cannot access each others. OS manages the whole thing, if something wrong happens OS throws Segmentation Fault. -Address space is virtual. Which is mapped to physical memory by OS. ๐๐๐: In simple words, a Process Control Block is a data structure used by OS to manage processes. Itโs like an ID Card for processes. Which includes: โข Process ID (PID): Unique id for the process. โข Process State: New, Ready, Running, Waiting