Date: August 30, 2024
Topic: Introduction to Processes
Recall
Process Attributes
Notes
Process Attributes
Processes are like an order of toys
- Has a state of executions:
- Program counter
- Stack pointer
- Parts and temporary holding area:
- Requires data, register state
- Occupies state in memory
- May require special hardware:
- May require I/O devices like disks or network devices
A process is an application that is executed
Multiple launches of the same application creates multiple processes
What is a Process?
The OS manages hardware on behalf of applications
Applications:
- Program on disk, flash memory (static entity)
Process:
- State of a program when executing loaded in memory (active entity)
- If application launched multiple times, multiple processes are created
- Likely will have different states even if launched from same program
A process encapsulates all data for a running application
A process contains:
What does a Process Look Like?
- A process encapsulates all the data for a running application (all code, data, etc)
- Every single element of process state has to be uniquely identified by its address
- OS abstraction used to encapsulate all of the process state is an address space
Types of States
Text and data
- Static state when process first loads
Heap - may not be contiguous and is dynamic

V represents the virtual addresses used
- During execution, process dynamically creates some state
- Allocates memory, stores temporary results, reads data from files
- This portion of address space is known as heap
- Dynamically created during execution
- Heap may not be contiguous in address space
Stack - contiguous and fixed
- Used for managing function calls and variables
- Contiguous in address space (allocated a fixed size upon creation)
- Grows and shrinks using a LIFO order as functions are called and returned
| Feature |
Stack |
Heap |
| Memory Allocation |
Static (Fixed size) |
Dynamic (Variable size) |
| Contiguous? |
Yes |
No |
| Speed |
Fast |
Slower |
| Management |
Automatic (by compiler) |
Manual (or automatic in GC) |
| Size Limit |
Typically small, fixed |
Larger, limited by RAM |
| Use Cases |
Function calls, local vars |
Dynamic memory, large data |
<aside>
📌 SUMMARY: A process is an instance of an application being executed. It encapsulates all data for a running application through the different states
</aside>
Date: August 30, 2024
Topic: Memory Management
<aside>
📌 SUMMARY: OS use page tables to map virtual memory from an application to physical memory in either the DRAM or disk. Virtual addresses are unique to the process.
</aside>