non-contiguous memory allocation Flashcards
what is paging
it is a non-contiguous memory allocation method where the physical memory block is divided into parts known as FRAMES and these are linked to their logical addresses which are also divided into parts known as PAGES.
the process of linking the Pages to Frames is known as paging.
page table
it is a data structure which stores the mapping of the Pages to their respective frames.
Segmentation
Basically we are aware that many times the process is broken down into many parts and all the parts are not loaded in the memory at the same time which might cause issue during the execution.
therefore we only divide the processes into segments with their offset so that they can be traced.
what is virtual memory.
it is a concept of illusion, that is here the secondary memory is also considered to be as main memory.
this technique allows the users to execute the processes which are completely not in the main memory.
what is demand paging
demand paging is a concept where we only fetch the required pages of the project which are responsible for the main execution.
and as we go the required pages are swapped into the main memory from the secondary memory this is known as lazy pager.
what is a page fault
as we know only the required pages are present in the main memory, and the presence of the page in the main memory can be determined with the help of the Valid bit in the page table.
when the requried page is not present in the main memory then page fault occurs(OS trap).
belady’s anomaly
this is a phenomenon where the page fault increases with increase in the number of frames.
FIFO
it is a page replacement algorithm, where the page which comes first is replaced first.
optimal page replacement
replace the page will be farthest use in the future.(no implacable in real scenario)
least recently used and most frequently used
replace it with the least recently used page this can be implemented with the help of count variable or with the help of stack.
and we replace the most recently used for MFU page replacement algorithm.
What is thrashing
frequently swap-ing in and swap-ing out of the page is know as thrashing.
a system is thrashing when it is busy in servicing the page faults than executing processes.
Techniques to handle the thrashing.
1). working set model: based on the locality model ( locality : the pages which are being actively used.) we allocate enough frames only for the active pages. and fault occurs only when the it moves to a new locality.
2). page fault frequency: by establishing the upper and lower bounds.