CH 3 OS Memory Managment
CH 3 OS Memory Managment
• 1. Page Hit
• When the CPU attempts to obtain a needed page from main
memory and the page exists in main memory (RAM), it is
referred to as a "PAGE HIT".
• 2. Page Miss
• If the needed page has not existed in the main memory
(RAM), it is known as "PAGE MISS".
• 3. Page Fault Time
• The time it takes to get a page from secondary memory and
recover it from the main memory after loading the required
page is known as "PAGE FAULT TIME".
• 4. Page Fault Delay
• The rate at which threads locate page faults in memory
is referred to as the "PAGE FAULT RATE". The page
fault rate is measured per second.
• 5. Hard Page Fault
• If a required page exists in the hard disk's page file, it is
referred to as a "HARD PAGE FAULT".
• 6. Soft Page Fault
• If a required page is not located on the hard disk but is
found somewhere else in memory, it is referred to as
a "SOFT PAGE FAULT".
• 7. Minor Page Fault
• If a process needs data and that data exists in memory
but is being allotted to another process at the same
moment, it is referred to as a "MINOR PAGE FAULT".
Demand Paging
• Every process in the virtual memory contains lots of pages
and in some cases, it might not be efficient to swap all the
pages for the process at once.
• Because it might be possible that the program may need
only a certain page for the application to run.
• Let us take an example here, suppose there is a 500 MB
application and it may need as little as 100MB pages to be
swapped, so in this case, there is no need to swap all
pages at once.
• The demand paging system is somehow similar to the
paging system with swapping where processes mainly
reside in the main memory(usually in the hard disk).
• Thus demand paging is the process that solves the
above problem only by swapping the pages on Demand.
• This is also known as lazy swapper( It never swaps the
page into the memory unless it is needed).
• Swapper that deals with the individual pages of a
process are referred to as Pager.
• Demand Paging is a technique in which a page is
usually brought into the main memory only when it is
needed or demanded by the CPU.
• Initially, only those pages are loaded that are required
by the process immediately.
• Those pages that are never accessed are thus never
loaded into the physical memory.
Demand Paging
• Main Memory
• CPU
• Secondary Memory
• Interrupt
• Physical Address space
• Logical Address space
• Operating System
• Page Table
Advantages of Demand Paging