Memory management Flashcards
logical address and physical address
logical address is generated by the CPU and does not exists physically.
Physical address is generated by the memory management unit and exists physically.
what is memory management unit.
MMU translates logical memory addresses into physical addresses in main memory
->The CPU generates a logical address, which is a virtual address that doesn’t exist physically.
-> The MMU maps the logical address to the physical address.
->The MMU dissects the virtual address into a virtual page number and a page offset.
->The MMU looks up the virtual page number in the TLB, looking for a tag with the corresponding number.
If there’s an entry in the TLB, the MMU can immediately translate the virtual address to the physical address.
Memory mapping
logical address is generally generated by the programs and logical address + relocation register gives us the physical address.
TLB
translation lookaside buffer
=>It is a cache memory that stores the recent transactions of the memory mapping
contiguous memory allocation
the processes are continuously allocated.
fixed partition
here the main memory is divided into fixed parts and the processes whose size is larger than the fixed memory you cannot allocate memory for it.
internal and external fragmentation is seen.
Dynamic Partitioning
here the partition’s are decided during the process loading.
-> no internal fragmentation, no limit to size of a process.
-> but the memory allocation is not continuous so we cannot combine two free spaces to allocate it to another process. (external fragmentation)
Defragmentation
a.k.a compaction is a process of grouping all the free spaces in the memory together so that large processes can be allocated memory.
the free-spaces are grouped together using linked-list. But this approach decreases the efficiency of the system.
first fit
allocate the first hole which is big enough for the process.
next fit
it is a modified version of the first fit, only difference is that it starts to search from the last allocated hole.
best fit
allocate the smallest hole which is big enough for the process.
worst fit
allocate the largest hole which is big enough for the process