Problem 2. An important aspect of any caching system is the question of how a cache entry is chosen for eviction from the cache when the cache is full and a new page must be added. (Note that here we do not have any notion of a "slot" any page can go anywhere in the cache.) There are a wide variety of possible strategies, for example FIFO, in which the page that has been in the cache longest is evicted, regardless of how many times it has been accessed. Another is least recently used, in which the cache keeps track of when a page was last accessed, and the one that was furthest back in the past is replaced. Suppose a user visits a sequence of pages (named by letters): a, b,c, c, d, a, e, f,c, b, a Where the pages take the following amounts of cache space: a: 10MB, b: 5MB, c: 3MB, d: 8MB, e: 7MB, f: 5MB.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
**Problem 2.** An important aspect of any caching system is the question of how a cache entry is chosen for **eviction** from the cache when the cache is full and a new page must be added. (Note that here we do not have any notion of a “slot”—any page can go anywhere in the cache.) There are a wide variety of possible strategies, for example **FIFO**, in which the page that has been in the cache longest is evicted, regardless of how many times it has been accessed. Another is **least recently used**, in which the cache keeps track of when a page was last accessed, and the one that was furthest back in the past is replaced. Suppose a user visits a sequence of pages (named by letters):

\[ a, b, c, c, d, a, e, f, c, b, a \]

Where the pages take the following amounts of cache space: 
\[ a: 10\text{MB}, \ b: 5\text{MB}, \ c: 3\text{MB}, \ d: 8\text{MB}, \ e: 7\text{MB}, \ f: 5\text{MB} \]
Transcribed Image Text:**Problem 2.** An important aspect of any caching system is the question of how a cache entry is chosen for **eviction** from the cache when the cache is full and a new page must be added. (Note that here we do not have any notion of a “slot”—any page can go anywhere in the cache.) There are a wide variety of possible strategies, for example **FIFO**, in which the page that has been in the cache longest is evicted, regardless of how many times it has been accessed. Another is **least recently used**, in which the cache keeps track of when a page was last accessed, and the one that was furthest back in the past is replaced. Suppose a user visits a sequence of pages (named by letters): \[ a, b, c, c, d, a, e, f, c, b, a \] Where the pages take the following amounts of cache space: \[ a: 10\text{MB}, \ b: 5\text{MB}, \ c: 3\text{MB}, \ d: 8\text{MB}, \ e: 7\text{MB}, \ f: 5\text{MB} \]
### Educational Content: Cache Management and Replacement Policies

#### Problem Overview

a. **Cache Size for Non-Eviction:**
   How large must the cache be to ensure that no page is evicted before a page is accessed a second time?

b. **Replacement Policy Scenario:**
   Suppose a browser uses the following replacement policy: when a page is accessed and there is not enough space in the cache, pages are evicted in First-In-First-Out (FIFO) order until there is sufficient space to add the new page. For instance, if the cache size is 10 MB, and the pages in the cache (from oldest to newest) have sizes of 2 MB, 4 MB, and 3 MB, then accessing a new 4 MB page necessitates evicting the two oldest pages (2 MB and 4 MB) to make room.

   Loading a page from the cache takes 100 microseconds, while loading it over the network takes 100 milliseconds (1,000 times longer), regardless of the page size. Calculate the total time needed to complete the sequence of accesses if the cache size is 20 MB.

c. **Exercise with Increased Cache Size:**
   Repeat the scenario for a cache size of 30 MB.

#### Detailed Explanation for Educational Use

**Understanding the Problem:**
- The goal is to analyze how different cache sizes and management policies affect the efficiency of data retrieval.
- The eviction policy here is FIFO, meaning the oldest pages are removed first to make room for new data.

**Steps to Approach:**
1. **Identify Page Access Sequence:**
   Determine the sequence and sizes of pages being accessed to understand when evictions occur.

2. **Calculate Required Cache Size (a):**
   To ensure no evictions, the cache must at least hold all accessed pages until they are accessed a second time.

3. **Evaluate with Given Cache Sizes (b, c):**
   - With a 20 MB cache, simulate the FIFO eviction and calculate load times based on whether pages are cached or loaded from the network.
   - Increase to a 30 MB cache and repeat, noting changes in eviction decisions and load times.

**Graphical Representation:**
If there were graphs or diagrams, they would typically depict the following:
- **Cache Size Utilization Over Time:**
  Showing how the cache fills and evicts pages as new pages are accessed.
- **Access Time Comparison:**
  A bar graph comparing
Transcribed Image Text:### Educational Content: Cache Management and Replacement Policies #### Problem Overview a. **Cache Size for Non-Eviction:** How large must the cache be to ensure that no page is evicted before a page is accessed a second time? b. **Replacement Policy Scenario:** Suppose a browser uses the following replacement policy: when a page is accessed and there is not enough space in the cache, pages are evicted in First-In-First-Out (FIFO) order until there is sufficient space to add the new page. For instance, if the cache size is 10 MB, and the pages in the cache (from oldest to newest) have sizes of 2 MB, 4 MB, and 3 MB, then accessing a new 4 MB page necessitates evicting the two oldest pages (2 MB and 4 MB) to make room. Loading a page from the cache takes 100 microseconds, while loading it over the network takes 100 milliseconds (1,000 times longer), regardless of the page size. Calculate the total time needed to complete the sequence of accesses if the cache size is 20 MB. c. **Exercise with Increased Cache Size:** Repeat the scenario for a cache size of 30 MB. #### Detailed Explanation for Educational Use **Understanding the Problem:** - The goal is to analyze how different cache sizes and management policies affect the efficiency of data retrieval. - The eviction policy here is FIFO, meaning the oldest pages are removed first to make room for new data. **Steps to Approach:** 1. **Identify Page Access Sequence:** Determine the sequence and sizes of pages being accessed to understand when evictions occur. 2. **Calculate Required Cache Size (a):** To ensure no evictions, the cache must at least hold all accessed pages until they are accessed a second time. 3. **Evaluate with Given Cache Sizes (b, c):** - With a 20 MB cache, simulate the FIFO eviction and calculate load times based on whether pages are cached or loaded from the network. - Increase to a 30 MB cache and repeat, noting changes in eviction decisions and load times. **Graphical Representation:** If there were graphs or diagrams, they would typically depict the following: - **Cache Size Utilization Over Time:** Showing how the cache fills and evicts pages as new pages are accessed. - **Access Time Comparison:** A bar graph comparing
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Properties of Different Architectures
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education