aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_init.c
diff options
context:
space:
mode:
authorJulien Barbot <[email protected]>2010-01-29 11:31:15 +0100
committerBjörn Gustavsson <[email protected]>2010-02-02 15:47:18 +0100
commit489577676f14d5ee62459f9134095d982a08e430 (patch)
tree6a9b01cfecf792b0e9577ca95cde7f87a30cc947 /erts/emulator/beam/erl_init.c
parent085012b1ac9251d1cbd821f8b28034072fba63c3 (diff)
downloadotp-489577676f14d5ee62459f9134095d982a08e430.tar.gz
otp-489577676f14d5ee62459f9134095d982a08e430.tar.bz2
otp-489577676f14d5ee62459f9134095d982a08e430.zip
Add the +t emulator option to change the maximum number of atoms
It is now possible to increase or decrease the maximum number of atoms the VM can handle. The default value is 1048576 (1024*1024).
Diffstat (limited to 'erts/emulator/beam/erl_init.c')
-rw-r--r--erts/emulator/beam/erl_init.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/erts/emulator/beam/erl_init.c b/erts/emulator/beam/erl_init.c
index bdf888eaff..17cf3b9597 100644
--- a/erts/emulator/beam/erl_init.c
+++ b/erts/emulator/beam/erl_init.c
@@ -119,6 +119,8 @@ int erts_disable_tolerant_timeofday; /* Time correction can be disabled it is
* not and/or it is too slow.
*/
+int erts_atom_table_size = ATOM_LIMIT; /* Maximum number of atoms */
+
int erts_modified_timing_level;
int erts_no_crash_dump = 0; /* Use -d to suppress crash dump. */
@@ -569,6 +571,10 @@ void erts_usage(void)
erts_fprintf(stderr, " schedulers online (n2), valid range for both\n");
erts_fprintf(stderr, " numbers are [1-%d]\n",
ERTS_MAX_NO_OF_SCHEDULERS);
+ erts_fprintf(stderr, "-t size set the maximum number of atoms the "
+ "emulator can handle\n");
+ erts_fprintf(stderr, " valid range is [%d-%d]\n",
+ MIN_ATOM_TABLE_SIZE, MAX_ATOM_TABLE_SIZE);
erts_fprintf(stderr, "-T number set modified timing level,\n");
erts_fprintf(stderr, " valid range is [0-%d]\n",
ERTS_MODIFIED_TIMING_LEVELS-1);
@@ -1140,6 +1146,22 @@ erl_start(int argc, char **argv)
}
break;
}
+ case 't':
+ /* set atom table size */
+ arg = get_arg(argv[i]+2, argv[i+1], &i);
+ errno = 0;
+ erts_atom_table_size = strtol(arg, NULL, 10);
+ if (errno != 0 ||
+ erts_atom_table_size < MIN_ATOM_TABLE_SIZE ||
+ erts_atom_table_size > MAX_ATOM_TABLE_SIZE) {
+ erts_fprintf(stderr, "bad atom table size %s\n", arg);
+ erts_usage();
+ }
+ VERBOSE(DEBUG_SYSTEM,
+ ("setting maximum number of atoms to %d\n",
+ erts_atom_table_size));
+ break;
+
case 'T' :
arg = get_arg(argv[i]+2, argv[i+1], &i);
errno = 0;