From 647a2b4dac949d50e01bfd541561f1e1ec1c890c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn-Egil=20Dahlberg?= Date: Tue, 15 Dec 2009 15:06:05 +0100 Subject: Add min heap size start options to beam and erl The erl (and beam) start arguments are extended with the following options: * +hms Size, sets the default minimum heap size for processes. * +hmbs Size, sets the default minimum binary virtual heap size for processes. The previous +h Size argument can still be used for backward compatibility purposes. --- erts/etc/common/erlexec.c | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) (limited to 'erts/etc/common/erlexec.c') diff --git a/erts/etc/common/erlexec.c b/erts/etc/common/erlexec.c index 4325418e7c..1fc753293f 100644 --- a/erts/etc/common/erlexec.c +++ b/erts/etc/common/erlexec.c @@ -123,6 +123,14 @@ static char *pluss_val_switches[] = { "ss", NULL }; +/* +h arguments with values */ +static char *plush_val_switches[] = { + "ms", + "mbs", + "", + NULL +}; + /* * Define sleep(seconds) in terms of Sleep() on Windows. @@ -783,7 +791,6 @@ int main(int argc, char **argv) case 'a': case 'A': case 'b': - case 'h': case 'i': case 'P': case 'S': @@ -850,6 +857,20 @@ int main(int argc, char **argv) goto the_default; break; } + case 'h': + if (!is_one_of_strings(&argv[i][2], plush_val_switches)) { + goto the_default; + } else { + if (i+1 >= argc + || argv[i+1][0] == '-' + || argv[i+1][0] == '+') + usage(argv[i]); + argv[i][0] = '-'; + add_Eargs(argv[i]); + add_Eargs(argv[i+1]); + i++; + } + break; case 's': if (!is_one_of_strings(&argv[i][2], pluss_val_switches)) @@ -1048,7 +1069,7 @@ usage_aux(void) #endif "[-make] [-man [manopts] MANPAGE] [-x] [-emu_args] " "[-args_file FILENAME] " - "[+A THREADS] [+a SIZE] [+B[c|d|i]] [+c] [+h HEAP_SIZE] [+K BOOLEAN] " + "[+A THREADS] [+a SIZE] [+B[c|d|i]] [+c] [+h HEAP_SIZE_OPTION] [+K BOOLEAN] " "[+l] [+M ] [+P MAX_PROCS] [+R COMPAT_REL] " "[+r] [+s SCHEDULER_OPTION] [+S NO_SCHEDULERS:NO_SCHEDULERS_ONLINE] [+T LEVEL] [+V] [+v] [+W] " "[args ...]\n"); -- cgit v1.2.3