From 2cdc8abe1276ea31951772829dcff3ba3c9f9c28 Mon Sep 17 00:00:00 2001 From: Kai Tamkun Date: Wed, 30 Jul 2025 15:39:44 -0700 Subject: [PATCH] (test) Report final RSS/committed in scripts/runner.node.mjs --- scripts/runner.node.mjs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/scripts/runner.node.mjs b/scripts/runner.node.mjs index a681c27baa..4e3f85ab77 100755 --- a/scripts/runner.node.mjs +++ b/scripts/runner.node.mjs @@ -2509,6 +2509,9 @@ export async function main() { const results = await runTests(); const ok = results.every(({ ok }) => ok); + console.log("Final RSS:", (process.memoryUsage.rss() / 1024 / 1024) | 0, "MiB"); + console.log("Final committed:", Math.round((100 * getCommitted()) / 1024 ** 2) / 100, "GiB"); + let waitForUser = false; while (isCI) { const userCount = getLoggedInUserCountOrDetails(); @@ -2536,3 +2539,13 @@ export async function main() { } await main(); + +function getCommitted() { + let child; + if (process.platform === "win32") { + child = spawnSync("wmic", ["process", "where", `processid=${process.pid}`, "get", "PageFileUsage"]); + } else { + child = spawnSync("ps", ["-o", "vsz", "-p", process.pid.toString()]); + } + return parseInt(child.stdout.toString().split("\n")[1].trim()); +}