MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / releaseIdleMemory

Method releaseIdleMemory

src/mcp/tools.ts:2706–2713  ·  view source on GitHub ↗

* A query worker kept through a quiet spell gives back what it can without * going cold: every project but the last one used closes, and what stays * open lets go of the memory it holds only to read faster. The heap needs * nothing from here: V8 shrinks an idle thread's by itself, well befo

()

Source from the content-addressed store, hash-verified

2704 * pool's idle delay is up.
2705 */
2706 releaseIdleMemory(): void {
2707 this.trimProjects(1);
2708 for (const cg of [this.cg, ...this.projectCache.values()]) {
2709 try {
2710 cg?.releaseMemory();
2711 } catch { /* one that can't let go still answers, and the others still can */ }
2712 }
2713 }
2714
2715 /**
2716 * Close all cached project connections

Callers 2

query-worker.tsFile · 0.80
query-pool.test.tsFile · 0.80

Calls 2

trimProjectsMethod · 0.95
releaseMemoryMethod · 0.45

Tested by

no test coverage detected