Skip to content

Commit fbf8faa

Browse files
committed
Merge branch 'maint'
* maint: erlc: Lower default number of ports/processes when starting erl
2 parents d98fb1c + 48ee10b commit fbf8faa

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

erts/etc/common/erlc.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,12 @@ int main(int argc, char** argv)
296296

297297
PUSH("+sbtu");
298298
PUSH("+A0");
299+
300+
/* Avoid wasting memory for processes and ports that will never be
301+
* used. */
302+
PUSH2("+P", "65536");
303+
PUSH2("+Q", "1024");
304+
299305
PUSH("-noinput");
300306
PUSH2("-mode", "minimal");
301307
PUSH2("-boot", "no_dot_erlang");
@@ -960,7 +966,13 @@ start_compile_server(char* node_name, char** argv)
960966
char* progname = argv[0];
961967

962968
while (strcmp(argv[0], "-mode") != 0) {
963-
eargv[eargc++] = *argv++;
969+
if (strcmp(argv[0], "+P") == 0 || strcmp(argv[0], "+Q") == 0) {
970+
/* We don't want to limit the number of ports and
971+
* processes for the compile server. */
972+
argv += 2;
973+
} else {
974+
eargv[eargc++] = *argv++;
975+
}
964976
}
965977
PUSH2("-boot", "no_dot_erlang");
966978
PUSH2("-sname", node_name);

0 commit comments

Comments
 (0)