SlideShare une entreprise Scribd logo
1  sur  10
Télécharger pour lire hors ligne
Swap-space
Management
Swap-Space Management
• Swap-space — virtual memory uses disk
space as an extension of main memory.
• Main goal for the design and
implementation of swap space is to
provide the best throughput for VM system
• Swap-space use –Swapping –use swap
space to hold entire process image –
Paging –store pages that have been
pushed out of memory
Swap-Space
Management(con..)
• Some OS may support multiple swap-
space
–Put on separate disks to balance the
load
• Better to overestimate than underestimate
–If out of swap-space, some
processes must be aborted or system
crashed
Swap-Space Location
• Swap-space can be carved out of the
normal file system, or in a separate disk
partition.
• A large file within the file system: simple
but inefficient
–Navigating the directory structure and
the disk-allocation data structure takes
time and potentially extra disk accesses
Swap-Space Location (con..)
–External fragmentation can greatly increase
swapping times by forcing multiple seeks during
reading or writing of a process image
–Improvement
• Caching block location information in main
memory
• Contiguous allocation for the swap file
–But, the cost of traversing FS data structure
still remains
Swap-Space Location (con..)
• In a separate partition: raw partition
–Create a swap space during disk partitioning
–A separate swap-space storage manager is
used to allocate and de-allocate blocks
–Use algorithms optimized for speed, rather
than storage efficiency –Internal fragment may
increase
•Linux supports both approaches
Swap-space Management:
Example
• Solaris 1
–Text-segment pages are brought in
from the file system and are thrown away
if selected for paged out
• More efficient to re-read from FS than
write it to the swap space
–Swap space: only used as a backing
store for pages of anonymous memory
Example
• Stack, heap, and uninitialized data
• Solaris 2
–Allocates swap space only when a
page is forced out of physical memory
• Not when the virtual memory page is first
created.
Data Structures for Swapping on
Linux Systems
Data Structures for Swapping on
Linux Systems

Contenu connexe

Tendances

Operating System-Ch8 memory management
Operating System-Ch8 memory managementOperating System-Ch8 memory management
Operating System-Ch8 memory managementSyaiful Ahdan
 
Query processing and optimization (updated)
Query processing and optimization (updated)Query processing and optimization (updated)
Query processing and optimization (updated)Ravinder Kamboj
 
Page replacement algorithms
Page replacement algorithmsPage replacement algorithms
Page replacement algorithmssangrampatil81
 
Memory management ppt
Memory management pptMemory management ppt
Memory management pptManishaJha43
 
Dma transfer
Dma transferDma transfer
Dma transfergmnithya
 
13. Query Processing in DBMS
13. Query Processing in DBMS13. Query Processing in DBMS
13. Query Processing in DBMSkoolkampus
 
Chapter 12 - Mass Storage Systems
Chapter 12 - Mass Storage SystemsChapter 12 - Mass Storage Systems
Chapter 12 - Mass Storage SystemsWayne Jones Jnr
 
Operating system paging and segmentation
Operating system paging and segmentationOperating system paging and segmentation
Operating system paging and segmentationhamza haseeb
 
Distributed Operating System,Network OS and Middle-ware.??
Distributed Operating System,Network OS and Middle-ware.??Distributed Operating System,Network OS and Middle-ware.??
Distributed Operating System,Network OS and Middle-ware.??Abdul Aslam
 
Thrashing allocation frames.43
Thrashing allocation frames.43Thrashing allocation frames.43
Thrashing allocation frames.43myrajendra
 
Memory Management in OS
Memory Management in OSMemory Management in OS
Memory Management in OSKumar Pritam
 
contiguous memory allocation.pptx
contiguous memory allocation.pptxcontiguous memory allocation.pptx
contiguous memory allocation.pptxRajapriya82
 
Distributed shred memory architecture
Distributed shred memory architectureDistributed shred memory architecture
Distributed shred memory architectureMaulik Togadiya
 
Contiguous Memory Allocation-R.D.Sivakumar
Contiguous Memory Allocation-R.D.SivakumarContiguous Memory Allocation-R.D.Sivakumar
Contiguous Memory Allocation-R.D.SivakumarSivakumar R D .
 
Operating System-Memory Management
Operating System-Memory ManagementOperating System-Memory Management
Operating System-Memory ManagementAkmal Cikmat
 
Disk Scheduling Algorithm in Operating System
Disk Scheduling Algorithm in Operating SystemDisk Scheduling Algorithm in Operating System
Disk Scheduling Algorithm in Operating SystemMeghaj Mallick
 

Tendances (20)

Operating System-Ch8 memory management
Operating System-Ch8 memory managementOperating System-Ch8 memory management
Operating System-Ch8 memory management
 
Query processing and optimization (updated)
Query processing and optimization (updated)Query processing and optimization (updated)
Query processing and optimization (updated)
 
Page replacement algorithms
Page replacement algorithmsPage replacement algorithms
Page replacement algorithms
 
Memory management ppt
Memory management pptMemory management ppt
Memory management ppt
 
Dma transfer
Dma transferDma transfer
Dma transfer
 
13. Query Processing in DBMS
13. Query Processing in DBMS13. Query Processing in DBMS
13. Query Processing in DBMS
 
Chapter 12 - Mass Storage Systems
Chapter 12 - Mass Storage SystemsChapter 12 - Mass Storage Systems
Chapter 12 - Mass Storage Systems
 
Disk scheduling
Disk schedulingDisk scheduling
Disk scheduling
 
Paging and segmentation
Paging and segmentationPaging and segmentation
Paging and segmentation
 
Operating system paging and segmentation
Operating system paging and segmentationOperating system paging and segmentation
Operating system paging and segmentation
 
Distributed Operating System,Network OS and Middle-ware.??
Distributed Operating System,Network OS and Middle-ware.??Distributed Operating System,Network OS and Middle-ware.??
Distributed Operating System,Network OS and Middle-ware.??
 
Thrashing allocation frames.43
Thrashing allocation frames.43Thrashing allocation frames.43
Thrashing allocation frames.43
 
Memory Management in OS
Memory Management in OSMemory Management in OS
Memory Management in OS
 
contiguous memory allocation.pptx
contiguous memory allocation.pptxcontiguous memory allocation.pptx
contiguous memory allocation.pptx
 
Distributed shred memory architecture
Distributed shred memory architectureDistributed shred memory architecture
Distributed shred memory architecture
 
Contiguous Memory Allocation-R.D.Sivakumar
Contiguous Memory Allocation-R.D.SivakumarContiguous Memory Allocation-R.D.Sivakumar
Contiguous Memory Allocation-R.D.Sivakumar
 
Memory virtualization
Memory virtualizationMemory virtualization
Memory virtualization
 
Operating System-Memory Management
Operating System-Memory ManagementOperating System-Memory Management
Operating System-Memory Management
 
Disk Scheduling Algorithm in Operating System
Disk Scheduling Algorithm in Operating SystemDisk Scheduling Algorithm in Operating System
Disk Scheduling Algorithm in Operating System
 
Fragmentaton
Fragmentaton Fragmentaton
Fragmentaton
 

Similaire à Swap-space Management (20)

Class notesfeb27
Class notesfeb27Class notesfeb27
Class notesfeb27
 
Os7
Os7Os7
Os7
 
Linux Memory Management
Linux Memory ManagementLinux Memory Management
Linux Memory Management
 
OS UNIT4.pptx
OS UNIT4.pptxOS UNIT4.pptx
OS UNIT4.pptx
 
UNIT IV.pptx
UNIT IV.pptxUNIT IV.pptx
UNIT IV.pptx
 
Module5 secondary storage
Module5 secondary storageModule5 secondary storage
Module5 secondary storage
 
Mass storage systemsos
Mass storage systemsosMass storage systemsos
Mass storage systemsos
 
Os unit 3
Os unit 3Os unit 3
Os unit 3
 
Driver development – memory management
Driver development – memory managementDriver development – memory management
Driver development – memory management
 
Swapping | Computer Science
Swapping | Computer ScienceSwapping | Computer Science
Swapping | Computer Science
 
Thiru
ThiruThiru
Thiru
 
kerch04.ppt
kerch04.pptkerch04.ppt
kerch04.ppt
 
Unit 4 DBMS.ppt
Unit 4 DBMS.pptUnit 4 DBMS.ppt
Unit 4 DBMS.ppt
 
08 operating system support
08 operating system support08 operating system support
08 operating system support
 
Massstorage
MassstorageMassstorage
Massstorage
 
File system and Deadlocks
File system and DeadlocksFile system and Deadlocks
File system and Deadlocks
 
UNIT-2 OS.pptx
UNIT-2 OS.pptxUNIT-2 OS.pptx
UNIT-2 OS.pptx
 
Os
OsOs
Os
 
Practical ,Transparent Operating System Support For Superpages
Practical ,Transparent Operating System Support For SuperpagesPractical ,Transparent Operating System Support For Superpages
Practical ,Transparent Operating System Support For Superpages
 
11. dfs
11. dfs11. dfs
11. dfs
 

Plus de Agnas Jasmine (8)

Kavi
KaviKavi
Kavi
 
Os
OsOs
Os
 
Os
OsOs
Os
 
Windows 2000
Windows 2000Windows 2000
Windows 2000
 
Disk structure
Disk structureDisk structure
Disk structure
 
Disk scheduling
Disk schedulingDisk scheduling
Disk scheduling
 
Disk management
Disk managementDisk management
Disk management
 
In out system
In out systemIn out system
In out system
 

Dernier

Check out the Free Landing Page Hosting in 2024
Check out the Free Landing Page Hosting in 2024Check out the Free Landing Page Hosting in 2024
Check out the Free Landing Page Hosting in 2024Shubham Pant
 
WordPress by the numbers - Jan Loeffler, CTO WebPros, CloudFest 2024
WordPress by the numbers - Jan Loeffler, CTO WebPros, CloudFest 2024WordPress by the numbers - Jan Loeffler, CTO WebPros, CloudFest 2024
WordPress by the numbers - Jan Loeffler, CTO WebPros, CloudFest 2024Jan Löffler
 
Computer 10 Lesson 8: Building a Website
Computer 10 Lesson 8: Building a WebsiteComputer 10 Lesson 8: Building a Website
Computer 10 Lesson 8: Building a WebsiteMavein
 
LESSON 10/ GROUP 10/ ST. THOMAS AQUINASS
LESSON 10/ GROUP 10/ ST. THOMAS AQUINASSLESSON 10/ GROUP 10/ ST. THOMAS AQUINASS
LESSON 10/ GROUP 10/ ST. THOMAS AQUINASSlesteraporado16
 
Presentation2.pptx - JoyPress Wordpress
Presentation2.pptx -  JoyPress WordpressPresentation2.pptx -  JoyPress Wordpress
Presentation2.pptx - JoyPress Wordpressssuser166378
 
TYPES AND DEFINITION OF ONLINE CRIMES AND HAZARDS
TYPES AND DEFINITION OF ONLINE CRIMES AND HAZARDSTYPES AND DEFINITION OF ONLINE CRIMES AND HAZARDS
TYPES AND DEFINITION OF ONLINE CRIMES AND HAZARDSedrianrheine
 
LESSON 5 GROUP 10 ST. THOMAS AQUINAS.pdf
LESSON 5 GROUP 10 ST. THOMAS AQUINAS.pdfLESSON 5 GROUP 10 ST. THOMAS AQUINAS.pdf
LESSON 5 GROUP 10 ST. THOMAS AQUINAS.pdfmchristianalwyn
 
Introduction to ICANN and Fellowship program by Shreedeep Rayamajhi.pdf
Introduction to ICANN and Fellowship program  by Shreedeep Rayamajhi.pdfIntroduction to ICANN and Fellowship program  by Shreedeep Rayamajhi.pdf
Introduction to ICANN and Fellowship program by Shreedeep Rayamajhi.pdfShreedeep Rayamajhi
 
Bio Medical Waste Management Guideliness 2023 ppt.pptx
Bio Medical Waste Management Guideliness 2023 ppt.pptxBio Medical Waste Management Guideliness 2023 ppt.pptx
Bio Medical Waste Management Guideliness 2023 ppt.pptxnaveenithkrishnan
 
Benefits of doing Internet peering and running an Internet Exchange (IX) pres...
Benefits of doing Internet peering and running an Internet Exchange (IX) pres...Benefits of doing Internet peering and running an Internet Exchange (IX) pres...
Benefits of doing Internet peering and running an Internet Exchange (IX) pres...APNIC
 
Zero-day Vulnerabilities
Zero-day VulnerabilitiesZero-day Vulnerabilities
Zero-day Vulnerabilitiesalihassaah1994
 
Vision Forward: Tracing Image Search SEO From Its Roots To AI-Enhanced Horizons
Vision Forward: Tracing Image Search SEO From Its Roots To AI-Enhanced HorizonsVision Forward: Tracing Image Search SEO From Its Roots To AI-Enhanced Horizons
Vision Forward: Tracing Image Search SEO From Its Roots To AI-Enhanced HorizonsRoxana Stingu
 

Dernier (12)

Check out the Free Landing Page Hosting in 2024
Check out the Free Landing Page Hosting in 2024Check out the Free Landing Page Hosting in 2024
Check out the Free Landing Page Hosting in 2024
 
WordPress by the numbers - Jan Loeffler, CTO WebPros, CloudFest 2024
WordPress by the numbers - Jan Loeffler, CTO WebPros, CloudFest 2024WordPress by the numbers - Jan Loeffler, CTO WebPros, CloudFest 2024
WordPress by the numbers - Jan Loeffler, CTO WebPros, CloudFest 2024
 
Computer 10 Lesson 8: Building a Website
Computer 10 Lesson 8: Building a WebsiteComputer 10 Lesson 8: Building a Website
Computer 10 Lesson 8: Building a Website
 
LESSON 10/ GROUP 10/ ST. THOMAS AQUINASS
LESSON 10/ GROUP 10/ ST. THOMAS AQUINASSLESSON 10/ GROUP 10/ ST. THOMAS AQUINASS
LESSON 10/ GROUP 10/ ST. THOMAS AQUINASS
 
Presentation2.pptx - JoyPress Wordpress
Presentation2.pptx -  JoyPress WordpressPresentation2.pptx -  JoyPress Wordpress
Presentation2.pptx - JoyPress Wordpress
 
TYPES AND DEFINITION OF ONLINE CRIMES AND HAZARDS
TYPES AND DEFINITION OF ONLINE CRIMES AND HAZARDSTYPES AND DEFINITION OF ONLINE CRIMES AND HAZARDS
TYPES AND DEFINITION OF ONLINE CRIMES AND HAZARDS
 
LESSON 5 GROUP 10 ST. THOMAS AQUINAS.pdf
LESSON 5 GROUP 10 ST. THOMAS AQUINAS.pdfLESSON 5 GROUP 10 ST. THOMAS AQUINAS.pdf
LESSON 5 GROUP 10 ST. THOMAS AQUINAS.pdf
 
Introduction to ICANN and Fellowship program by Shreedeep Rayamajhi.pdf
Introduction to ICANN and Fellowship program  by Shreedeep Rayamajhi.pdfIntroduction to ICANN and Fellowship program  by Shreedeep Rayamajhi.pdf
Introduction to ICANN and Fellowship program by Shreedeep Rayamajhi.pdf
 
Bio Medical Waste Management Guideliness 2023 ppt.pptx
Bio Medical Waste Management Guideliness 2023 ppt.pptxBio Medical Waste Management Guideliness 2023 ppt.pptx
Bio Medical Waste Management Guideliness 2023 ppt.pptx
 
Benefits of doing Internet peering and running an Internet Exchange (IX) pres...
Benefits of doing Internet peering and running an Internet Exchange (IX) pres...Benefits of doing Internet peering and running an Internet Exchange (IX) pres...
Benefits of doing Internet peering and running an Internet Exchange (IX) pres...
 
Zero-day Vulnerabilities
Zero-day VulnerabilitiesZero-day Vulnerabilities
Zero-day Vulnerabilities
 
Vision Forward: Tracing Image Search SEO From Its Roots To AI-Enhanced Horizons
Vision Forward: Tracing Image Search SEO From Its Roots To AI-Enhanced HorizonsVision Forward: Tracing Image Search SEO From Its Roots To AI-Enhanced Horizons
Vision Forward: Tracing Image Search SEO From Its Roots To AI-Enhanced Horizons
 

Swap-space Management

  • 2. Swap-Space Management • Swap-space — virtual memory uses disk space as an extension of main memory. • Main goal for the design and implementation of swap space is to provide the best throughput for VM system • Swap-space use –Swapping –use swap space to hold entire process image – Paging –store pages that have been pushed out of memory
  • 3. Swap-Space Management(con..) • Some OS may support multiple swap- space –Put on separate disks to balance the load • Better to overestimate than underestimate –If out of swap-space, some processes must be aborted or system crashed
  • 4. Swap-Space Location • Swap-space can be carved out of the normal file system, or in a separate disk partition. • A large file within the file system: simple but inefficient –Navigating the directory structure and the disk-allocation data structure takes time and potentially extra disk accesses
  • 5. Swap-Space Location (con..) –External fragmentation can greatly increase swapping times by forcing multiple seeks during reading or writing of a process image –Improvement • Caching block location information in main memory • Contiguous allocation for the swap file –But, the cost of traversing FS data structure still remains
  • 6. Swap-Space Location (con..) • In a separate partition: raw partition –Create a swap space during disk partitioning –A separate swap-space storage manager is used to allocate and de-allocate blocks –Use algorithms optimized for speed, rather than storage efficiency –Internal fragment may increase •Linux supports both approaches
  • 7. Swap-space Management: Example • Solaris 1 –Text-segment pages are brought in from the file system and are thrown away if selected for paged out • More efficient to re-read from FS than write it to the swap space –Swap space: only used as a backing store for pages of anonymous memory
  • 8. Example • Stack, heap, and uninitialized data • Solaris 2 –Allocates swap space only when a page is forced out of physical memory • Not when the virtual memory page is first created.
  • 9. Data Structures for Swapping on Linux Systems
  • 10. Data Structures for Swapping on Linux Systems