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

Function memoryBudgetBytes

src/resolution/memory-budget.ts:115–123  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

113 * construction — every number shrinks as the process itself grows.
114 */
115export function memoryBudgetBytes(): number {
116 const free = os.freemem();
117 const cgroup = cgroupMemoryAvailable();
118 if (cgroup !== null) return Math.min(free, cgroup);
119 // darwinAvailable ⊇ free by construction (the sum includes free pages);
120 // max() guards a hypothetical undercounting parse.
121 const darwin = darwinMemoryAvailable();
122 return darwin === null ? free : Math.max(free, darwin);
123}

Callers 3

tryCreateMethod · 0.90
cFnPointerDispatchEdgesFunction · 0.90

Calls 2

cgroupMemoryAvailableFunction · 0.85
darwinMemoryAvailableFunction · 0.85

Tested by

no test coverage detected