aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_init.c
diff options
context:
space:
mode:
authorRickard Green <[email protected]>2015-09-16 15:02:50 +0200
committerRickard Green <[email protected]>2015-11-12 15:25:48 +0100
commit3ac08f9b668613a4292436979eacc61863c2ab94 (patch)
tree8635b3377426bf1a332148b778189e9c61005c6d /erts/emulator/beam/erl_init.c
parentec4a7e7150c47523a553cac806c86ec08ab2dae7 (diff)
downloadotp-3ac08f9b668613a4292436979eacc61863c2ab94.tar.gz
otp-3ac08f9b668613a4292436979eacc61863c2ab94.tar.bz2
otp-3ac08f9b668613a4292436979eacc61863c2ab94.zip
Fragmented young heap generation and off_heap_message_queue option
* The youngest generation of the heap can now consist of multiple blocks. Heap fragments and message fragments are added to the youngest generation when needed without triggering a GC. After a GC the youngest generation is contained in one single block. * The off_heap_message_queue process flag has been added. When enabled all message data in the queue is kept off heap. When a message is selected from the queue, the message fragment (or heap fragment) containing the actual message is attached to the youngest generation. Messages stored off heap is not part of GC.
Diffstat (limited to 'erts/emulator/beam/erl_init.c')
-rw-r--r--erts/emulator/beam/erl_init.c26
1 files changed, 24 insertions, 2 deletions
diff --git a/erts/emulator/beam/erl_init.c b/erts/emulator/beam/erl_init.c
index 5c209a4af2..f396a0a156 100644
--- a/erts/emulator/beam/erl_init.c
+++ b/erts/emulator/beam/erl_init.c
@@ -431,7 +431,7 @@ erl_first_process_otp(char* modname, void* code, unsigned size, int argc, char**
hp += 2;
args = CONS(hp, env, args);
- so.flags = SPO_SYSTEM_PROC;
+ so.flags = erts_default_spo_flags|SPO_SYSTEM_PROC;
res = erl_create_process(&parent, start_mod, am_start, args, &so);
erts_smp_proc_unlock(&parent, ERTS_PROC_LOCK_MAIN);
erts_cleanup_empty_process(&parent);
@@ -630,6 +630,7 @@ void erts_usage(void)
erts_fprintf(stderr, "-W<i|w|e> set error logger warnings mapping,\n");
erts_fprintf(stderr, " see error_logger documentation for details\n");
+ erts_fprintf(stderr, "-xohmq bool set default off_heap_message_queue flag for processes\n");
erts_fprintf(stderr, "-zdbbl size set the distribution buffer busy limit in kilobytes\n");
erts_fprintf(stderr, " valid range is [1-%d]\n", INT_MAX/1024);
erts_fprintf(stderr, "-zdntgc time set delayed node table gc in seconds\n");
@@ -2015,6 +2016,26 @@ erl_start(int argc, char **argv)
}
break;
+ case 'x': {
+ char *sub_param = argv[i]+2;
+ if (has_prefix("ohmq", sub_param)) {
+ arg = get_arg(sub_param+4, argv[i+1], &i);
+ if (sys_strcmp(arg, "true") == 0)
+ erts_default_spo_flags |= SPO_OFF_HEAP_MSGQ;
+ else if (sys_strcmp(arg, "false") == 0)
+ erts_default_spo_flags &= ~SPO_OFF_HEAP_MSGQ;
+ else {
+ erts_fprintf(stderr,
+ "Invalid off_heap_message_queue flag: %s\n", arg);
+ erts_usage();
+ }
+ } else {
+ erts_fprintf(stderr, "bad -x option %s\n", argv[i]);
+ erts_usage();
+ }
+ break;
+ }
+
case 'z': {
char *sub_param = argv[i]+2;
@@ -2068,7 +2089,8 @@ erl_start(int argc, char **argv)
"Invalid ets busy wait threshold: %s\n", arg);
erts_usage();
}
- } else {
+ }
+ else {
erts_fprintf(stderr, "bad -z option %s\n", argv[i]);
erts_usage();
}