(test) Report final RSS/committed in scripts/runner.node.mjs

This commit is contained in:
Kai Tamkun
2025-07-30 15:39:44 -07:00
parent a1f44caa87
commit 2cdc8abe12

View File

@@ -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());
}