Skip to content

Node.js based forum software built for the modern web

feat: allow setting max-old-space-size in config

Barış Soner Uşaklıd1ce594cc96d
diff --git a/loader.js b/loader.js
index a960327208..91bc605572 100644
--- a/loader.js
+++ b/loader.js
@@ -99,7 +99,9 @@ Loader.start = function () {
function forkWorker(index, isPrimary) {
const ports = getPorts();
const args = [];
-
+ if (nconf.get('max-memory')) {
+ args.push(`--max-old-space-size=${nconf.get('max-memory')}`);
+ }
if (!ports[index]) {
return console.log(`[cluster] invalid port for worker : ${index} ports: ${ports.length}`);
}