evictOldest() — mcp Function Reference
Architecture documentation for the evictOldest() function in graph-cache.ts from the mcp codebase.
Entity Profile
Dependency Diagram
graph TD 2b1b6788_6d42_4aa6_fb22_d64dd55ac2a3["evictOldest()"] b965d3cf_dacd_81fc_77e7_dbe9bdef8bbc["set()"] b965d3cf_dacd_81fc_77e7_dbe9bdef8bbc -->|calls| 2b1b6788_6d42_4aa6_fb22_d64dd55ac2a3 55bde18a_7860_173e_f211_5874970475e3["get()"] 2b1b6788_6d42_4aa6_fb22_d64dd55ac2a3 -->|calls| 55bde18a_7860_173e_f211_5874970475e3 style 2b1b6788_6d42_4aa6_fb22_d64dd55ac2a3 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
Calls
Called By
Source
Frequently Asked Questions
What does evictOldest() do?
evictOldest() is a function in the mcp codebase.
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