Memory Allocation of a Process

202310082304
Status: #idea
Tags: OS

Memory Allocation of a Process

img92.jpg|Linux Process' Runtime Memory

Note

Middle region has memory mapped for shared libraries.
Ex: When reading a file, a full block of data is read.

Info

Frame pointer -> Top of the frame
Stack pointer -> Points to last element in stack
Global pointer -> Points to the starting of global space

Attention

Stack pointer=frame pointer when stack is empty

img84.jpg|Memory layout a C Program

Attention

Stack grows down and heap grows up

Note

static data is global data.

Attention

PCB has a fixed size.
PID serves as the index in an array of PCBs

Dispatcher


References