(name: string)
| 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. |