evictOldest() — mcp Function Reference
Architecture documentation for the evictOldest() function in graph-cache.ts from the mcp codebase.
Entity Profile
Dependency Diagram
graph TD aa12a27e_97dc_0771_0ad0_d1af55e1e15d["evictOldest()"] 04799611_7360_96bd_a002_0c06de0b1d90["GraphCache"] aa12a27e_97dc_0771_0ad0_d1af55e1e15d -->|defined in| 04799611_7360_96bd_a002_0c06de0b1d90 4e1e5a38_002c_8f16_1767_0260a7001d5e["set()"] 4e1e5a38_002c_8f16_1767_0260a7001d5e -->|calls| aa12a27e_97dc_0771_0ad0_d1af55e1e15d 2ef71e67_fa6d_b33f_d005_85a400698718["get()"] aa12a27e_97dc_0771_0ad0_d1af55e1e15d -->|calls| 2ef71e67_fa6d_b33f_d005_85a400698718 style aa12a27e_97dc_0771_0ad0_d1af55e1e15d fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
src/cache/graph-cache.ts lines 314–330
private evictOldest(): void {
let oldestKey: string | null = null;
let oldestTime = Infinity;
for (const [key, entry] of this.cache) {
if (entry.lastAccessed < oldestTime) {
oldestTime = entry.lastAccessed;
oldestKey = key;
}
}
if (oldestKey) {
const entry = this.cache.get(oldestKey)!;
this.currentNodes -= entry.nodeCount;
this.cache.delete(oldestKey);
}
}
Domain
Subdomains
Defined In
Calls
Called By
Source
Frequently Asked Questions
What does evictOldest() do?
evictOldest() is a function in the mcp codebase, defined in src/cache/graph-cache.ts.
Where is evictOldest() defined?
evictOldest() is defined in src/cache/graph-cache.ts at line 314.
What does evictOldest() call?
evictOldest() calls 1 function(s): get.
What calls evictOldest()?
evictOldest() is called by 1 function(s): set.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free