• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests
July 01, 2022 |10.8K Views
Last In First Out (LIFO) | Page Replacement Algorithm in OS
  Share   Like
Description
Discussion

Last In First Out (LIFO) algorithm replaces the page that was last inserted into the main memory i.e. the most recent insertion. A stack is used by the LIFO algorithm to track the insertion order of pages. The most recent page is always present at the top of the stack. In case of a page fault, the page at the top of the stack will be replaced by the page that has been requested by the CPU. Sometimes, LIFO algorithm may lead to an increase in the number of page faults as compared to other page replacement algorithms. Simple logic means easy to understand. Easy implementation using the stack data structure. Minimal overhead. It ignores the principle of Locality of reference and this may lead to performance degradation. Since LIFO replaces the newest inserted page always, old pages may occupy memory space for a long time.

Read More