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

Method releaseIdleMemory

src/mcp/tools.ts:2732–2739  ·  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

2730 * pool's idle delay is up.
2731 */
2732 releaseIdleMemory(): void {
2733 this.trimProjects(1);
2734 for (const cg of [this.cg, ...this.projectCache.values()]) {
2735 try {
2736 cg?.releaseMemory();
2737 } catch { /* one that can't let go still answers, and the others still can */ }
2738 }
2739 }
2740
2741 /**
2742 * 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