evictOldest() — mcp Function Reference
Architecture documentation for the evictOldest() function in graph-cache.ts from the mcp codebase.
Entity Profile
Dependency Diagram
graph TD 044b41f9_d555_74fb_d6a4_6889502cdf08["evictOldest()"] 6407330b_8aa1_cc04_569a_747f6b1debfd["set()"] 6407330b_8aa1_cc04_569a_747f6b1debfd -->|calls| 044b41f9_d555_74fb_d6a4_6889502cdf08 d6ed9355_f977_306b_b0ef_d7220fdefe68["get()"] 044b41f9_d555_74fb_d6a4_6889502cdf08 -->|calls| d6ed9355_f977_306b_b0ef_d7220fdefe68 style 044b41f9_d555_74fb_d6a4_6889502cdf08 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