SlideShare a Scribd company logo
1 of 16
Linux Memory Management Case Study :                            Operating System Muhammad  Ather  Rasool    IS/17115/Aut-07/M Muhammad Muzammil         IS/17104/Aut-07/M Muhammad Zahid Majeed     IS/17105/Aut-07/M Federal Urdu university of Arts, Science & Technology,.
Introduction: Linux is a UNIX like system that has gained popularity in recent years. Development begins in 1991. Two different GUI (GNOME & KDE) for Linux. In early days, Linux development revolved around central OS kernel. Linux kernel:   Is an entirely original piece of SW developed from scratch by the Linux community.
Components of Linux Memory Two Components Physical memory: kernel is loaded in memory rest of memory is available for user pages  Allocate and free physical memory pages Virtual Memory:  Each Linux process on a 32 bit get 3 GB for virtual addressing Remaining 1 GB reserve for its Page Table and kernel data Frequently accessed pages will be on the "hot" list Free pages will be on the "cold" or "free" list
Paging Page Size: Intel 4 KB, Alpha 8 KB Linux kernel is the page allocator Each process has its own page table The entire page table may take up too much main memory Page tables are also stored in virtual memory When a process is running, part of its page table is in main memory
Fetch Policy Linux use a demand paging  With no preparing  And no working set concept There is a system call in which user can give a hint that a certain page may be needed soon Demand paging
Linux Memory Management Three level page table structure Page directory Page middle directory Page table 6
7 Fig 1
Placement Policy All page frames are grouped into 10 lists of blocks that contain groups of 1, 2, 4, 8, 16, 32,64, 128, 256, and 512 contiguous page frames respectively  If a small area is needed and only a larger area is available, the larger area is split into two Halves (buddies), possibly repeatedly When a block is released, the kernel attempts to merge together pairs of free buddy Buddy Algorithm
Buddy Algorithm problem Linux manages memory using the buddy algorithm. The algorithm leads to the internal fragmentation because if we want 65 page chunks w required 128 page chunks For this problem to solve Linux has a second memory allocation which manages smaller units separately
Fig 2:Buddy Algorithm
Replacement Policy Paging system  can divided into two sections  First policy algorithm decides which pages to write out to disk, and when to write them. Second the paging mechanism carries out the transfer and pages data back into physical memory when they are needed again. Under Linux a clock is used, and every page has an age that is adjusted on each pass of the clock Age is measure of youthfulness of pages
Clock Algorithm – Another Implementation of Second Chance Order pages in circular list “Hand” of the clock points to the page to be replaced currently When required to evict a page If page pointed to has R=0, then evict it If R=1, then reset R and move hand forward Clock algorithm can be used with NRU (decision based on both R and M bits)
Fig 3: Clock Algorithm for replacement
Replacement Scope Local replacement policy – chooses only among the resident pages of the process that generated page fault in selecting a page to replace Global replacement policy – considers all unlocked pages in main memory as candidates for replacement, regardless of which process owns a particular page Global policies are more attractive because of the simplicity of implementation and minimal overhead
References Picture: Fig 1:operating System 4th Edition by William Stalling Fig 2:Modern  operating Systems 2nd Edition by A Tanenbaum. Fig 3:operating System 4th Edition by William Stalling Text: Modern  operating Systems 2nd Edition by A Tanenbaum. operating System 4th Edition by William Stalling
G4 Group

More Related Content

What's hot

Chapter 9 - Virtual Memory
Chapter 9 - Virtual MemoryChapter 9 - Virtual Memory
Chapter 9 - Virtual MemoryWayne Jones Jnr
 
Linux kernel Architecture and Properties
Linux kernel Architecture and PropertiesLinux kernel Architecture and Properties
Linux kernel Architecture and PropertiesSaadi Rahman
 
Linux kernel architecture
Linux kernel architectureLinux kernel architecture
Linux kernel architectureSHAJANA BASHEER
 
chapter 1 introduction to operating system
chapter 1 introduction to operating systemchapter 1 introduction to operating system
chapter 1 introduction to operating systemAisyah Rafiuddin
 
Memory Management
Memory ManagementMemory Management
Memory ManagementSanthiNivas
 
Operating Systems - "Chapter 4: Multithreaded Programming"
Operating Systems - "Chapter 4:  Multithreaded Programming"Operating Systems - "Chapter 4:  Multithreaded Programming"
Operating Systems - "Chapter 4: Multithreaded Programming"Ra'Fat Al-Msie'deen
 
Os solaris memory management
Os  solaris memory managementOs  solaris memory management
Os solaris memory managementTech_MX
 
Linux architecture
Linux architectureLinux architecture
Linux architecturemcganesh
 
Virtual memory - Demand Paging
Virtual memory - Demand PagingVirtual memory - Demand Paging
Virtual memory - Demand Pagingjeyaperumal
 
Deadlock in OS
Deadlock in OSDeadlock in OS
Deadlock in OSKioRox
 
Windows vs linux prsentsn
Windows vs linux prsentsnWindows vs linux prsentsn
Windows vs linux prsentsnAnadi Vatsa
 
Chapter 10 Operating Systems silberschatz
Chapter 10 Operating Systems silberschatzChapter 10 Operating Systems silberschatz
Chapter 10 Operating Systems silberschatzGiulianoRanauro
 
Operating System-Threads-Galvin
Operating System-Threads-GalvinOperating System-Threads-Galvin
Operating System-Threads-GalvinSonali Chauhan
 
Memory : operating system ( Btech cse )
Memory : operating system ( Btech cse )Memory : operating system ( Btech cse )
Memory : operating system ( Btech cse )HimanshuSharma1389
 
what is LINUX ? presentation.
what is LINUX ? presentation.what is LINUX ? presentation.
what is LINUX ? presentation.saad_khan1122
 

What's hot (20)

Chapter 9 - Virtual Memory
Chapter 9 - Virtual MemoryChapter 9 - Virtual Memory
Chapter 9 - Virtual Memory
 
Linux kernel Architecture and Properties
Linux kernel Architecture and PropertiesLinux kernel Architecture and Properties
Linux kernel Architecture and Properties
 
Linux kernel architecture
Linux kernel architectureLinux kernel architecture
Linux kernel architecture
 
Operating System Lecture 1
Operating System Lecture 1Operating System Lecture 1
Operating System Lecture 1
 
chapter 1 introduction to operating system
chapter 1 introduction to operating systemchapter 1 introduction to operating system
chapter 1 introduction to operating system
 
Linux file system
Linux file systemLinux file system
Linux file system
 
Memory Management
Memory ManagementMemory Management
Memory Management
 
Linux Memory Management
Linux Memory ManagementLinux Memory Management
Linux Memory Management
 
Operating Systems - "Chapter 4: Multithreaded Programming"
Operating Systems - "Chapter 4:  Multithreaded Programming"Operating Systems - "Chapter 4:  Multithreaded Programming"
Operating Systems - "Chapter 4: Multithreaded Programming"
 
Os solaris memory management
Os  solaris memory managementOs  solaris memory management
Os solaris memory management
 
Linux architecture
Linux architectureLinux architecture
Linux architecture
 
Virtual memory - Demand Paging
Virtual memory - Demand PagingVirtual memory - Demand Paging
Virtual memory - Demand Paging
 
Architecture of Linux
 Architecture of Linux Architecture of Linux
Architecture of Linux
 
Deadlock in OS
Deadlock in OSDeadlock in OS
Deadlock in OS
 
Semaphore
SemaphoreSemaphore
Semaphore
 
Windows vs linux prsentsn
Windows vs linux prsentsnWindows vs linux prsentsn
Windows vs linux prsentsn
 
Chapter 10 Operating Systems silberschatz
Chapter 10 Operating Systems silberschatzChapter 10 Operating Systems silberschatz
Chapter 10 Operating Systems silberschatz
 
Operating System-Threads-Galvin
Operating System-Threads-GalvinOperating System-Threads-Galvin
Operating System-Threads-Galvin
 
Memory : operating system ( Btech cse )
Memory : operating system ( Btech cse )Memory : operating system ( Btech cse )
Memory : operating system ( Btech cse )
 
what is LINUX ? presentation.
what is LINUX ? presentation.what is LINUX ? presentation.
what is LINUX ? presentation.
 

Similar to Os Linux

Hsc computer science paper 1 chap 1 OperatingSystem2024.pdf
Hsc computer science paper 1 chap 1 OperatingSystem2024.pdfHsc computer science paper 1 chap 1 OperatingSystem2024.pdf
Hsc computer science paper 1 chap 1 OperatingSystem2024.pdfAAFREEN SHAIKH
 
Windows
WindowsWindows
WindowsEzzah
 
Memory management in_windows_os
Memory management in_windows_osMemory management in_windows_os
Memory management in_windows_osVidhyavaniA
 
I/O System and Case study
I/O System and Case studyI/O System and Case study
I/O System and Case studymalarselvi mms
 
Paging +Algorithem+Segmentation+memory management
Paging +Algorithem+Segmentation+memory managementPaging +Algorithem+Segmentation+memory management
Paging +Algorithem+Segmentation+memory managementkazim Hussain
 
Memory organization (Computer architecture)
Memory organization (Computer architecture)Memory organization (Computer architecture)
Memory organization (Computer architecture)Sandesh Jonchhe
 
Linux Memory Management with CMA (Contiguous Memory Allocator)
Linux Memory Management with CMA (Contiguous Memory Allocator)Linux Memory Management with CMA (Contiguous Memory Allocator)
Linux Memory Management with CMA (Contiguous Memory Allocator)Pankaj Suryawanshi
 
I/O System and Case Study
I/O System and Case StudyI/O System and Case Study
I/O System and Case StudyGRamya Bharathi
 
Windows 7 Architecture
Windows 7 ArchitectureWindows 7 Architecture
Windows 7 ArchitectureDaniyal Khan
 
IT109 Microsoft Windows 7 Operating Systems Unit 01
IT109 Microsoft Windows 7 Operating Systems Unit 01IT109 Microsoft Windows 7 Operating Systems Unit 01
IT109 Microsoft Windows 7 Operating Systems Unit 01blusmurfydot1
 
Operating system Memory management
Operating system Memory management Operating system Memory management
Operating system Memory management Shashank Asthana
 
Virtual Memory In Contemporary Microprocessors And 64-Bit Microprocessors Arc...
Virtual Memory In Contemporary Microprocessors And 64-Bit Microprocessors Arc...Virtual Memory In Contemporary Microprocessors And 64-Bit Microprocessors Arc...
Virtual Memory In Contemporary Microprocessors And 64-Bit Microprocessors Arc...Anurag Deb
 

Similar to Os Linux (20)

Os Linux Documentation
Os Linux DocumentationOs Linux Documentation
Os Linux Documentation
 
Hsc computer science paper 1 chap 1 OperatingSystem2024.pdf
Hsc computer science paper 1 chap 1 OperatingSystem2024.pdfHsc computer science paper 1 chap 1 OperatingSystem2024.pdf
Hsc computer science paper 1 chap 1 OperatingSystem2024.pdf
 
Os
OsOs
Os
 
Windows xp
Windows xpWindows xp
Windows xp
 
Windows
WindowsWindows
Windows
 
Memory management in_windows_os
Memory management in_windows_osMemory management in_windows_os
Memory management in_windows_os
 
I/O System and Case study
I/O System and Case studyI/O System and Case study
I/O System and Case study
 
Paging +Algorithem+Segmentation+memory management
Paging +Algorithem+Segmentation+memory managementPaging +Algorithem+Segmentation+memory management
Paging +Algorithem+Segmentation+memory management
 
Memory organization (Computer architecture)
Memory organization (Computer architecture)Memory organization (Computer architecture)
Memory organization (Computer architecture)
 
Linux Memory Management with CMA (Contiguous Memory Allocator)
Linux Memory Management with CMA (Contiguous Memory Allocator)Linux Memory Management with CMA (Contiguous Memory Allocator)
Linux Memory Management with CMA (Contiguous Memory Allocator)
 
I/O System and Case Study
I/O System and Case StudyI/O System and Case Study
I/O System and Case Study
 
Windows 7 Architecture
Windows 7 ArchitectureWindows 7 Architecture
Windows 7 Architecture
 
Virtual memory 20070222-en
Virtual memory 20070222-enVirtual memory 20070222-en
Virtual memory 20070222-en
 
Memory comp
Memory compMemory comp
Memory comp
 
IT109 Microsoft Windows 7 Operating Systems Unit 01
IT109 Microsoft Windows 7 Operating Systems Unit 01IT109 Microsoft Windows 7 Operating Systems Unit 01
IT109 Microsoft Windows 7 Operating Systems Unit 01
 
Operating system Memory management
Operating system Memory management Operating system Memory management
Operating system Memory management
 
Nachos 2
Nachos 2Nachos 2
Nachos 2
 
virtual memory - Computer operating system
virtual memory - Computer operating systemvirtual memory - Computer operating system
virtual memory - Computer operating system
 
ppt
pptppt
ppt
 
Virtual Memory In Contemporary Microprocessors And 64-Bit Microprocessors Arc...
Virtual Memory In Contemporary Microprocessors And 64-Bit Microprocessors Arc...Virtual Memory In Contemporary Microprocessors And 64-Bit Microprocessors Arc...
Virtual Memory In Contemporary Microprocessors And 64-Bit Microprocessors Arc...
 

More from Federal Urdu University (20)

Ntc internship report
Ntc internship reportNtc internship report
Ntc internship report
 
Network security at_osi_layers
Network security at_osi_layersNetwork security at_osi_layers
Network security at_osi_layers
 
Network Security Lec4
Network Security Lec4Network Security Lec4
Network Security Lec4
 
Network Security Lec5
Network Security  Lec5Network Security  Lec5
Network Security Lec5
 
Network Security
Network SecurityNetwork Security
Network Security
 
Unix
UnixUnix
Unix
 
Maria Managment Spectrum
Maria Managment SpectrumMaria Managment Spectrum
Maria Managment Spectrum
 
Zohaib Dfd
Zohaib DfdZohaib Dfd
Zohaib Dfd
 
Zeeshan Estimation
Zeeshan EstimationZeeshan Estimation
Zeeshan Estimation
 
Zahid Asd
Zahid AsdZahid Asd
Zahid Asd
 
Umar Erd
Umar ErdUmar Erd
Umar Erd
 
Sohrab Waterfall Vs Rad
Sohrab Waterfall Vs RadSohrab Waterfall Vs Rad
Sohrab Waterfall Vs Rad
 
Sidra Agile Software Process
Sidra Agile Software ProcessSidra Agile Software Process
Sidra Agile Software Process
 
Muzammil Prescriptive Vs Agile Process Models
Muzammil Prescriptive Vs Agile Process ModelsMuzammil Prescriptive Vs Agile Process Models
Muzammil Prescriptive Vs Agile Process Models
 
Muzammil Agile Vs Prescriptive
Muzammil Agile Vs PrescriptiveMuzammil Agile Vs Prescriptive
Muzammil Agile Vs Prescriptive
 
Khurram Spiral
Khurram SpiralKhurram Spiral
Khurram Spiral
 
Hira Xp
Hira XpHira Xp
Hira Xp
 
G4 Group
G4 GroupG4 Group
G4 Group
 
Faisal Incremental Model
Faisal Incremental ModelFaisal Incremental Model
Faisal Incremental Model
 
Ather Proactive Vs Reactive
Ather Proactive Vs ReactiveAther Proactive Vs Reactive
Ather Proactive Vs Reactive
 

Recently uploaded

Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 

Recently uploaded (20)

Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 

Os Linux

  • 1. Linux Memory Management Case Study : Operating System Muhammad Ather Rasool IS/17115/Aut-07/M Muhammad Muzammil IS/17104/Aut-07/M Muhammad Zahid Majeed IS/17105/Aut-07/M Federal Urdu university of Arts, Science & Technology,.
  • 2. Introduction: Linux is a UNIX like system that has gained popularity in recent years. Development begins in 1991. Two different GUI (GNOME & KDE) for Linux. In early days, Linux development revolved around central OS kernel. Linux kernel: Is an entirely original piece of SW developed from scratch by the Linux community.
  • 3. Components of Linux Memory Two Components Physical memory: kernel is loaded in memory rest of memory is available for user pages Allocate and free physical memory pages Virtual Memory: Each Linux process on a 32 bit get 3 GB for virtual addressing Remaining 1 GB reserve for its Page Table and kernel data Frequently accessed pages will be on the "hot" list Free pages will be on the "cold" or "free" list
  • 4. Paging Page Size: Intel 4 KB, Alpha 8 KB Linux kernel is the page allocator Each process has its own page table The entire page table may take up too much main memory Page tables are also stored in virtual memory When a process is running, part of its page table is in main memory
  • 5. Fetch Policy Linux use a demand paging With no preparing And no working set concept There is a system call in which user can give a hint that a certain page may be needed soon Demand paging
  • 6. Linux Memory Management Three level page table structure Page directory Page middle directory Page table 6
  • 8. Placement Policy All page frames are grouped into 10 lists of blocks that contain groups of 1, 2, 4, 8, 16, 32,64, 128, 256, and 512 contiguous page frames respectively If a small area is needed and only a larger area is available, the larger area is split into two Halves (buddies), possibly repeatedly When a block is released, the kernel attempts to merge together pairs of free buddy Buddy Algorithm
  • 9. Buddy Algorithm problem Linux manages memory using the buddy algorithm. The algorithm leads to the internal fragmentation because if we want 65 page chunks w required 128 page chunks For this problem to solve Linux has a second memory allocation which manages smaller units separately
  • 11. Replacement Policy Paging system can divided into two sections First policy algorithm decides which pages to write out to disk, and when to write them. Second the paging mechanism carries out the transfer and pages data back into physical memory when they are needed again. Under Linux a clock is used, and every page has an age that is adjusted on each pass of the clock Age is measure of youthfulness of pages
  • 12. Clock Algorithm – Another Implementation of Second Chance Order pages in circular list “Hand” of the clock points to the page to be replaced currently When required to evict a page If page pointed to has R=0, then evict it If R=1, then reset R and move hand forward Clock algorithm can be used with NRU (decision based on both R and M bits)
  • 13. Fig 3: Clock Algorithm for replacement
  • 14. Replacement Scope Local replacement policy – chooses only among the resident pages of the process that generated page fault in selecting a page to replace Global replacement policy – considers all unlocked pages in main memory as candidates for replacement, regardless of which process owns a particular page Global policies are more attractive because of the simplicity of implementation and minimal overhead
  • 15. References Picture: Fig 1:operating System 4th Edition by William Stalling Fig 2:Modern operating Systems 2nd Edition by A Tanenbaum. Fig 3:operating System 4th Edition by William Stalling Text: Modern operating Systems 2nd Edition by A Tanenbaum. operating System 4th Edition by William Stalling