Please enable JavaScript.
Coggle requires JavaScript to display documents.
Memory Management (Basics (base register holds the smallest legal physical…
Memory Management
Basics
-
-
Compile time: the process will reside in memory, then absolute code can be generated
Load time: the process will reside in memory, then the compiler must generate relocatable code
Execution time: process can be moved during its execution from one memory segment to another, then binding must be delayed until run time
-
address seen by the memory unit - that is, the one loaded into the memory-address register of the memory - is commonly referred to as a physical address.
Virtual Memory
Virtual Memory is a storage allocation scheme in which secondary memory can be addressed as though it were part of main memory. The addresses a program may use to reference memory are distinguished from the addresses the memory system uses to identify physical storage sites, and program generated addresses are translated automatically to the corresponding machine addresses.
Demand Paging: The process of loading the page into memory on demand (whenever page fault occurs) is known as demand paging. Demand paging requires a page-replacement algorithm and a frame allocation algorithm.
Allocation of Frames
-
Algorithms
Equal allocation: In a system with x frames and y processes, each process gets equal number of frames, i.e. x/y.
-
Numerical
Memory Allocation
First Fit, Best Fit, Worst Fit
-
Swapping
Swapping a process out means removing all of its pages from memory, or marking them so that they will be removed by the normal page replacement process. Suspending a process ensures that it is not runnable while it is swapped out. At some later time, the system swaps back the process from the secondary storage to main memory. When a process is busy swapping pages in and out then this situation is called thrashing.
Paging
With Paging, Physical memory is broken into fixed-sized blocks called frames. Logical memory is also broken into blocks of the same size called pages. When a process is to be executed, its pages are loaded into any available memory frames from the backing store.
Segmentation
Segmentation is a technique for allocating memory in chunks of varying and meaningful sizes instead of one arbitrary page size. Since the segment sizes are selected by the compiler, internal fragmentation is reduced. The segments are of different sizes
Frame allocation algorithms are used if you have multiple processes; it helps decide how many frames to allocate to each process.