MCPcopy Create free account
hub / github.com/modem-dev/hunk / valueKb

Function valueKb

scripts/daemon-memory-check.ts:194–197  ·  view source on GitHub ↗
(name: string)

Source from the content-addressed store, hash-verified

192 try {
193 const status = readFileSync(`/proc/${pid}/status`, "utf8");
194 const valueKb = (name: string) => {
195 const match = status.match(new RegExp(`^${name}:\\s+(\\d+)\\s+kB`, "m"));
196 return match ? Number(match[1]) * 1024 : null;
197 };
198 return {
199 rssBytes: valueKb("VmRSS") ?? 0,
200 // External process probes cannot reliably read Bun's JS heap; RSS is the leak signal here.

Callers 1

parseLinuxStatusFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected