diff --git a/src/applications/aphlict/management/PhabricatorAphlictManagementWorkflow.php b/src/applications/aphlict/management/PhabricatorAphlictManagementWorkflow.php --- a/src/applications/aphlict/management/PhabricatorAphlictManagementWorkflow.php +++ b/src/applications/aphlict/management/PhabricatorAphlictManagementWorkflow.php @@ -78,6 +78,7 @@ 'logs' => 'optional list', 'cluster' => 'optional list', 'pidfile' => 'string', + 'memory.hint' => 'optional int', )); } catch (Exception $ex) { throw new PhutilArgumentUsageException( @@ -508,10 +509,22 @@ return $root.'/support/aphlict/server/aphlict_server.js'; } + private function getNodeArgv() { + $argv = array(); + + $hint = idx($this->configData, 'memory.hint'); + $hint = nonempty($hint, 256); + + $argv[] = sprintf('--max-old-space-size=%d', $hint); + + return $argv; + } + private function getStartCommand(array $server_argv) { return csprintf( - '%s %s %Ls', + '%R %Ls -- %s %Ls', $this->getNodeBinary(), + $this->getNodeArgv(), $this->getAphlictScriptPath(), $server_argv); } diff --git a/src/docs/user/configuration/notifications.diviner b/src/docs/user/configuration/notifications.diviner --- a/src/docs/user/configuration/notifications.diviner +++ b/src/docs/user/configuration/notifications.diviner @@ -80,6 +80,9 @@ - `cluster`: //Optional list.// A list of cluster peers. This is an advanced feature. - `pidfile`: //Required string.// Path to a PID file. + - `memory.hint`: //Optional int.// Suggestion to `node` about how much + memory to use, via `--max-old-stack-size`. In most cases, this can be + left unspecified. Each server in the `servers` list should be an object with these keys: