ARC & 2Q Adaptive Cache

T1/T2 cache data · B1/B2 ghosts drive the self-tuning target p · watch a scan NOT pollute the cache

Controls

 
T1 recency (seen once) T2 frequency (seen 2+) B1/B2 ghosts (key only)

ARC State — four lists (MRU on the left, LRU/oldest on the right)

T1 cached, seen once (recency) 0 entries
T2 cached, seen 2+ (frequency) 0 entries
B1 (ghost) evicted from T1, keys only 0 ghosts
B2 (ghost) evicted from T2, keys only 0 ghosts

Adaptive target p — recency budget vs frequency budget

← T1 target (recency) = p p = 0 / c = 6 T2 target (frequency) = c − p →

What just happened

Type a key and press Access. The first access puts a key in T1. A second access promotes it to T2. Press Run Scan to flood new keys and watch T2 (your hot set) survive — that is scan resistance.

Live Stats

0
hits
0
misses
0
ghost hits
0%
hit ratio
0
p (T1 target)
0
directory / 2c

Complexity

OperationTime
get / putO(1) avg
REPLACE (evict)O(1)
ghost hit + p updateO(1)
data memoryO(c)
ghost memoryO(c) keys
total directory≤ 2c

Shadow LRU (same stream)

A plain LRU cache of size c fed the identical access stream, for contrast.
0
LRU hits
0%
LRU hit ratio
Run a scan: LRU's ratio collapses as its hot set is evicted; ARC's holds.

Operation Log