Memory management of OS
Function of memory management
memory management is the function responsible for managing the computer's primary memory :
click to edit
Different levels in the hierachy of memory organization
Level 0: CPU registers.
Level 1: Cache memory.
Level 2: Primary memory or main memory.
Level 3: Secondary memory or magnetic disks or solid-state storage.
Level 4: Tertiary memory or optical disks or magnetic tapes.
Memory management strategies
a. Fetch - Determine when to load and how much to load at a time
b. Placement
i) best fit
advantage = minimizing external fragmentation
disadvantage = more internal fragmentation
ii) first fit
advantage = simple and efficient
disadvantage = poor performance in situations where the memory is highly fragmented
Identify between Resident and Transient routines
c. Replacement - When a page that is residing in virtual memory is requested by a process for its execution, the Operating System needs to decide which page will be replaced by this requested page.
Memory swapping technique during system processing
Swapping is a memory management technique used in multi-programming to increase the number of processes sharing the CPU.
It is a technique of removing a process from the main memory and storing it into secondary memory, and then bringing it back into the main memory for continued execution.
Fixed-partition memory management as applied in multiproogramming system
Multi-programming with fixed partitioning is a contiguous memory management technique in which the main memory is divided into fixed sized partitions which can be of equal or unequal size.
Whenever we have to allocate a process memory then a free partition that is big enough to hold the process is found.
Resident Routine
Transient Routine
Virtual memory
a. Segmentation
advantage = allows the operating system to better manage its memory use and improve the performance of the system
disadvantage = it can have external fragmentation
b. Paging
advantage = Paging is an easy to use algorithm for memory management.
disadvantage = Multi-level paging can cause memory reference overhead.
- permanent memory
- stay for a short time
- routine that directly support application programs as they run
- ex . routine that physical I/O
- stored on disk and read into memory only when needed
- ex. routine that formats disks