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

Function readInactiveFile

src/resolution/memory-budget.ts:40–47  ·  view source on GitHub ↗

`inactive_file` from a cgroup memory.stat file — reclaimable page cache.

(statPath: string)

Source from the content-addressed store, hash-verified

38
39/** `inactive_file` from a cgroup memory.stat file — reclaimable page cache. */
40function readInactiveFile(statPath: string): number {
41 try {
42 const m = /^inactive_file (\d+)$/m.exec(fs.readFileSync(statPath, 'utf8'));
43 return m ? Number.parseInt(m[1]!, 10) : 0;
44 } catch {
45 return 0;
46 }
47}
48
49/**
50 * Available headroom under the cgroup memory limit (v2 then v1), or null

Callers 1

cgroupMemoryAvailableFunction · 0.85

Calls 1

execMethod · 0.65

Tested by

no test coverage detected