Bound renderer memory use and configure worker heap ceiling

This commit is contained in:
2026-10-04 19:17:15 +05:00
parent a44e28c99f
commit 3b3cf6997c
4 changed files with 47 additions and 6 deletions

View File

@@ -34,4 +34,10 @@ run([
"--hostname",
process.env.MINEGEO_HOST || "127.0.0.1",
]);
run(["--import", "tsx", "worker/main.ts"]);
const workerHeap = Number(process.env.MINEGEO_WORKER_HEAP_MB || 4096);
if (!Number.isInteger(workerHeap) || workerHeap < 512 || workerHeap > 32768) {
console.error("MINEGEO_WORKER_HEAP_MB must be an integer between 512 and 32768.");
stop(1);
} else {
run([`--max-old-space-size=${workerHeap}`, "--import", "tsx", "worker/main.ts"]);
}