memory management - planned organization of programs and data in memory
goals of memory management - maximize the usage of memory to reduce waste, make it as simple for programs to find space to load
importance of memory management - reduce fragmentation, better utilize of memory
memory manager - responsible to keep track of which part of memory is in use and which part are not
memory is divided to - logical address and physical address
logical address - address that is generated by CPU
physical address - address seen by memory unit, load into MAR
memory management techniques - single tasking with overlay, fixed memory partitioning, variable memory partitioning
single tasking with overlay - allow for process to be larger than the size of physical memory(virtual memory), keep instructions and data in memory only
disadvantages of single tasking with overlay - even if there are extra memory, the process cant use it because it is fixed to a specific amount of memory
fixed memory partitioning - divide the memory into partitions, simplest form of memory management, dividing memory into fixed spaces
variable memory partitioning - search for large enough space for this process, load the process using first bit, best fit or worst fit algorithm
first bit - allocate the first space available to fit the process
best fit - allocate the smallest space that will fit the process
worst fit - allocate the largest space
fragmentation - cause by memory partitioning, occur when small pieces of memory left unused, external fragmentation, internal fragmentation
external fragmentation - small space that cannot be used for anything, cause by variable partitioning
resolve external fragmentation - compaction: shuffles all free memory space together to form a large space
internal fragmentation - fixed partitioning leads to this issue as extra memory allocated is not used