Week 5 Flashcards
Why is memory management important?
Memory management is important because we must keep many processes in memory to increase computing performance
What are the two types of addresses?
- Logical address -
- Generated by the CPU.
- Does not exist physically
- Used as a reference to access the physical address - Physical address -
- References a location in the memory
- Not directly accessible to the user program.
- A logical address needs to be mapped to make the address accessible
- The mapping is done by memory management unit (MMU)
What is logical address space?
Logical address space is the set of all logical addresses generated in reference to a program by the CPU
What is physical address space?
Physical address space is the set of all the physical addresses mapped to the logical address
What is contiguous memory allocation?
Contiguous memory allocation is an early method in which each process is contained in a single section of memory that is contiguous to the section containing the next process.
What is a hole?
A hole is a block of available memory. Holes of various sizes are scattered throughout memory.
What are the three types of storage allocation?
- First-fit - Allocate the first hole that is big enough
- Best-fit - Allocate the smallest hole that is big enough. Must search entire list. This produces the smallest leftover hole
- Worst-fit - Allocate the largest hole. Must also search the entire list. This produces the largest leftover hole
What is fragmentation?
Fragmentation is where as processes get loaded and removed from memory these spaces get broken into small pieces of memory that can’t be allocated to the coming processes.
What is internal fragmentation?
Internal fragmentation is where a process is allocated into a memory block but part of that memory is left unused. For example, a 3MB process put into a 4MB memory hole would leave 1MB leftover
What is external fragmentation?
External fragmentation is where there is enough total space available for a new process but because the memory is not contiguous the new process cannot be loaded into memory
What is compaction?
Compaction is a method used to reduce external fragmentation by shuffling memory contents to place all free memory together in one large block. Compaction is only possible if relocation is dynamic
What is paging?
Paging involves breaking physical memory into fixed-sized blocks called frames and breaking logical memory into blocks of the same size called pages. A process is then divided into small pages and these pages are allocated non-contiguously into the memory. When a process is to be executed it is divided into same fixed sized blocks as the memory frames. There is no external fragmentation as it allows use to store data in a non-contiguous way
What are the parts of a logical address?
- Page number (p) - It tells the exact page of the process which the CPU wants to access
- Page offset (d) - It tells the exact word on that page which the CPU wants to read
What are the parts of a physical address?
- Frame number - It tells the exact frame where the page is stored in physical memory
- Page offset (d) - It tells the exact word on that page which the CPU wants to read. It requires no translation as the page size is the same as the frame size so the place of the word which CPU wants to access will not change
What is the page table?
A page table contains the address of each frame in physical memory, and the offset is the location in the frame being referenced