Brief
Summarize memory segment
Basic memory segment
Nevertheless any languages, basic memory segment is like the below.
The roles of respective segments are like the below.
Stack segment
Contains stack. Stack is basically used for function calling. Nested functions are put in stack.
Heap segment
Contains heap. Heap is used for dynamic data which is not put in stack.
BSS segment
Contains uninitialized variables including static.
e.g.
int a;
static int a;
Data segment
Contains variables which have a pre-defined variables.
e.g.
int a = 8;
static int a = 8;
char String[] = "hoge";
Text segment
Contains mechanical languages. Data in this segment is always read only.