Processes
A process is basically a program in execution. The execution of a process must progress in a sequential fashion.
To put it in simple terms, we write our computer programs in a text file and when we execute this program, it becomes a process which performs all the tasks mentioned in the program.
When a program is loaded into the memory and it becomes a process, it can be divided into four sections ─ stack, heap, text and data.
Stack
The process Stack contains the temporary data such as method/function parameters, return address and local variables.
Heap
This is dynamically allocated memory to a process during its run time.
Text
This includes the current activity represented by the value of Program Counter and the contents of the processor's registers.
Data
This section contains the global and static variables.