Dynamic Cache Resizing to Mitigate Avoidable Thrashing

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Cache performance degrades due to immutability in configuration and behavior, leading to cache thrashing, which increases latency, reduces cache life, and wastes resources, especially under fluctuating workloads.

Innovation Solution

A system that dynamically adjusts cache behavior by tracking cache misses and evictions using metadata, incrementing a victim hit counter to measure avoidable thrashing, and adjusting cache policy to optimize capacity and resource allocation based on workload demands.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Device complexity

If cache size and behavior are fixed (immutable), then cache policy implementation is simple, but cache performance degrades under fluctuating workloads due to thrashing

Engineering Contradiction:
Improvecache policy implementation complexityVSAvoidcache throughput
Core Design Contradiction:
Device complexityVSProductivity

Solution Approach 1:

The patent implements dynamic cache resizing that adjusts cache capacity based on detected workload patterns and thrashing metrics. The cache transitions from a static fixed-size structure to a dynamic structure that expands or contracts automatically, allowing the system to maintain optimal performance across varying workload conditions without manual intervention.

Inventive Principle:
Principle #15Dynamics

Solution Approach 2:

The system changes the cache capacity parameter dynamically based on monitored performance metrics. By adjusting the cache size parameter in response to detected thrashing conditions or idle capacity, the system adapts to workload fluctuations, resolving the contradiction between simple fixed implementation and optimal variable performance.

Inventive Principle:
Principle #35Parameter changes

2Adaptability or versatility

If cache repeatedly evicts and reloads same data item (thrashing), then cache makes room for recently used data, but latency increases and cache life reduces

Engineering Contradiction:
Improvecache data residency flexibilityVSAvoiddata load latency
Core Design Contradiction:
Adaptability or versatilityVSLoss of time

Solution Approach 1:

The patent implements a feedback mechanism that monitors cache performance metrics including eviction patterns and hit rates. When thrashing is detected through these feedback signals, the system responds by adjusting cache capacity or policy to prevent repeated evictions of frequently accessed data, thereby reducing latency without sacrificing necessary data residency flexibility.

Inventive Principle:
Principle #23Feedback

Solution Approach 2:

The system proactively detects early signs of thrashing and preemptively adjusts cache capacity before severe performance degradation occurs. By cushioning against future thrashing events through anticipatory cache resizing, the system prevents latency increases rather than reacting after they occur.

Inventive Principle:
Principle #11Beforehand cushioning (Prior cushioning)

3Reliability

If cache is enlarged to prevent thrashing, then cache can retain more data items, but memory resources are wasted when cache is under-utilized

Engineering Contradiction:
Improvecache performance stabilityVSAvoidmemory resource waste
Core Design Contradiction:
ReliabilityVSLoss of energy

Solution Approach 1:

Rather than statically enlarging the cache to prevent worst-case thrashing, the patent implements dynamic cache resizing that adjusts capacity in real-time based on actual utilization and workload demands. This allows the cache to maintain stability and prevent thrashing when needed while contracting to free memory resources during under-utilization periods.

Inventive Principle:
Principle #15Dynamics

Solution Approach 2:

The cache system autonomously monitors its own performance and self-adjusts its capacity without external intervention. By serving its own resizing needs based on internal metrics, the system ensures performance stability while avoiding persistent resource waste, as the cache only maintains large capacity when actually beneficial.

Inventive Principle:
Principle #25Self-service

4Speed

If scan fills cache with data unlikely to be accessed again, then scan data is available in cache, but cache capacity is consumed by useless data

Engineering Contradiction:
Improvescan data access speedVSAvoiduseful cache capacity
Core Design Contradiction:
SpeedVSQuantity of substance

Solution Approach 1:

The patent applies different cache retention policies to different data categories or access patterns. By identifying scan data as a distinct category with different accessibility characteristics, the system can apply localized quality adjustments such as shorter retention periods or lower priority for eviction protection, preserving useful cache capacity for data that benefits from caching while maintaining fast scan data access during the scan operation.

Inventive Principle:
Principle #3Local quality

Data Source

PatentUS11138131B2Detection of avoidable cache thrashing for OLTP and DW workloads
Publication Date: 2021.10.05 ORACLE INT CORP
  • US11138131B2 patent drawing
  • US11138131B2 patent drawing
  • US11138131B2 patent drawing

AI summary

Techniques are provided to adjust the behavior of a cache based on a count of cache misses for items recently evicted. In an embodiment, a computer responds to evicting a particular item (PI) from a cache by storing a metadata entry for the PI into memory. In response to a cache miss for the PI, the computer detects whether or not the metadata entry for the PI resides in memory. When the metadata entry for the PI is detected in memory, the computer increments a victim hit counter (VHC) that may be used to calculate how much avoidable thrashing is the cache experiencing, which is how much thrashing would be reduced if the cache were expanded. Either immediately or arbitrarily later, the computer adjusts a policy of the cache based on the VHC's value. For example, the computer may adjust the capacity of the cache based on the VHC.