buffer management
Download
Skip this Video
Download Presentation
Buffer Management

Loading in 2 Seconds...

play fullscreen
1 / 8

Buffer Management - PowerPoint PPT Presentation


  • 109 Views
  • Uploaded on

Buffer Management. The buffer manager reads disk pages into a main memory page as needed. The general idea is to minimize the amount of disk I/O by keeping likely-to-be-requested pages in memory. Overview. Requests. The collection of main memory pages used by the

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about ' Buffer Management' - lieu


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
buffer management
Buffer Management

The buffer manager reads disk pages into a

main memory page as needed. The general

idea is to minimize the amount of disk I/O by

keeping likely-to-be-requested pages in

memory.

overview
Overview

Requests

The collection of main memory pages used by the

buffer manager to store needed data is called the

buffer pool.

Buffer Manager

memory

disk

Disk Files

when a page is requested
When a Page is Requested...
  • If the requested page is not in the pool:
    • Choose a buffer block for replacement
    • If it has been modified, write it back to the disk
    • Read the requested page into the buffer block
  • Pin the page and return its address
    • A pin_count is used since a page can be requested multiple times.
when a page is released
When a Page is Released...
  • Requestor of page must unpin it after using, and indicate if the page has been modified.
    • Set the dirty flag accordingly
    • Decrement the pin_count
    • A page is a candidate for replacement iff its pin_count = 0
buffer replacement strategies 1
Buffer Replacement Strategies(1)
  • Least-Recently Used (LRU)
    • Choose the block that has not been accessed for the longest time
    • Intuitively, buffers that have not been used for a long time are less likely to be accessed sooner than those that have been accessed recently
    • Maintain information after each access operation
buffer replacement strategies 2
Buffer Replacement Strategies(2)
  • Most-Recently Used (MRU)
    • Opposite to LRU
  • First-In-First-Out (FIFO)
    • Choose the block that has been occupied by the same page for the longest time
    • Require less maintenance than LRU, but it can make more mistakes. A block used repeatedly will eventually become the oldest block in the pool. It will be written back only to be reread shortly thereafter into another block
buffer replacement strategies 3
Buffer Replacement Strategies(3)
  • Clock
    • Efficient approximation to LRU
    • Think of the buffer blocks as arranged in a circle, each associated with a flag, which is either 0 or 1. Blocks with a 0 flag are vulnerable to be replaced, while with a 1 flag are not. When the block is accessed, its flag is set to 1
buffer replacement strategies 4

0

0

0

0

1

1

1

1

0

0

1

0

1

0

1

0

Buffer Replacement Strategies(4)
  • The buffer manager maintain a “hand” pointing to one of the blocks. When choosing a block for replacement, it looks for the first 0 it can find, rotating clockwise, and sets all 1’s it passed to 0
ad