-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
erts: Implement max_heap_size process flag #1032
erts: Implement max_heap_size process flag #1032
Commits on Mar 13, 2016
-
Add diameter_tcp option throttle_cb
To let a callback module decide whether or to receive another message from the peer, so that backpressure can be applied when it's inappropriate. This is to let a callback protect against reading more than can be processed, which is otherwise possible since diameter_tcp otherwise always asks for more. A callback is made after each message, and can answer to continue reading or to ask again after a timeout. It's each message instead of each packet partly for simplicity, but also since this should be sufficiently fine-grained. Per packet would require some interaction with the fragment timer that flushes partial messages that haven't been completely received.
Anders Svensson committedMar 13, 2016 Configuration menu - View commit details
-
Copy full SHA for 472a080 - Browse repository at this point
Copy the full SHA 472a080View commit details -
Make throttling callbacks on message reception
The callback is now applied to the atom 'false' when asking if another message should be received on the socket, and to a received binary message after reception. Throttling on received messages makes it possible to distinguish between requests and answers. There is no callback on outgoing messages since these don't have to go through the transport process, even if they currently do.
Anders Svensson committedMar 13, 2016 Configuration menu - View commit details
-
Copy full SHA for e7b286c - Browse repository at this point
Copy the full SHA e7b286cView commit details -
Let throttling callback return a notification pid
In addition to returning ok or {timeout, Tmo}, let a throttling callback for message reception return a pid(), which is then notified if the message in question is either discarded or results in a request process. Notification is by way of messages of the form {diameter, discard | {request, pid()}} where the pid is that of a request process resulting from the received message. This allows the notification process to keep track of the maximum number of request processes a peer connection can have given rise to.
Anders Svensson committedMar 13, 2016 Configuration menu - View commit details
-
Copy full SHA for 2ffb288 - Browse repository at this point
Copy the full SHA 2ffb288View commit details -
Let a throttling callback discard a received message
This can be used as a simple form of overload protection, discarding the message before it's passed into diameter to become one more request process in a flood. Replying with 3004 would be more appropriate when the request has been directed at a specific server (the RFC's requirement) however, and possibly it should be possible for a callback to do this as well.
Anders Svensson committedMar 13, 2016 Configuration menu - View commit details
-
Copy full SHA for 993d540 - Browse repository at this point
Copy the full SHA 993d540View commit details -
Let a throttling callback answer a received message
As discussed in the parent commit. This is easier said than done in practice, but there's no harm in allowing it.
Anders Svensson committedMar 13, 2016 Configuration menu - View commit details
-
Copy full SHA for 9298872 - Browse repository at this point
Copy the full SHA 9298872View commit details -
Don't ask throttling callback to receive more unless needed
TCP packets can contain more than one message, so only ask to receive another message if it hasn't already been received.
Anders Svensson committedMar 13, 2016 Configuration menu - View commit details
-
Copy full SHA for eae5e81 - Browse repository at this point
Copy the full SHA eae5e81View commit details -
In particular, let a callback decide when to receive the initial message.
Anders Svensson committedMar 13, 2016 Configuration menu - View commit details
-
Copy full SHA for 8f9173b - Browse repository at this point
Copy the full SHA 8f9173bView commit details -
Acknowledge answers to notification pids when throttling
By sending {diameter, {answer, pid()}} when an incoming answer is sent to the specified pid, instead of a discard message as previously. The latter now literally means that the message has been discarded.
Anders Svensson committedMar 13, 2016 Configuration menu - View commit details
-
Copy full SHA for c322099 - Browse repository at this point
Copy the full SHA c322099View commit details
Commits on Mar 18, 2016
-
Let throttling callback send a throttle message
That is, don't assume that it's only diameter_tcp doing so: allow it to be received when not throttling. This lets a callback module trigger a new throttling callback itself, but it's not clear if this will be useful in practice.
Anders Svensson committedMar 18, 2016 Configuration menu - View commit details
-
Copy full SHA for 14eb86d - Browse repository at this point
Copy the full SHA 14eb86dView commit details
Commits on Mar 25, 2016
-
Don't assume list comprehension evaluation order
Anders Svensson committedMar 25, 2016 Configuration menu - View commit details
-
Copy full SHA for a54a911 - Browse repository at this point
Copy the full SHA a54a911View commit details
Commits on Apr 20, 2016
-
erts: Produce statistics for literal and hipe super carriers
called 'literal_mmap' and 'exec_mmap'. Also moved existing erts_mmap info from 'mseg_alloc' to its own system_info({allocator, erts_mmap}) with "allocators" default_mmap, literal_mmap and exec_mmap.
Configuration menu - View commit details
-
Copy full SHA for 4319cd6 - Browse repository at this point
Copy the full SHA 4319cd6View commit details
Commits on Apr 29, 2016
-
erts: Move option info for erts_mmap
from {allocator,mseg_alloc} to {allocator,erts_mmap}
Configuration menu - View commit details
-
Copy full SHA for c2c4744 - Browse repository at this point
Copy the full SHA c2c4744View commit details -
erts: Add literal_mmap and exec_mmap to system_info
erlang:system_info(allocator) -> {Allocator, Version, Features, Settings} Features includes 'literal_mmap' and/or 'exec_mmap' if they exist.
Configuration menu - View commit details
-
Copy full SHA for 0a5d8f3 - Browse repository at this point
Copy the full SHA 0a5d8f3View commit details -
erts: Add erts_mmap to system_info(allocator)
to the Settings list {Allocator, Version, Features, Settings}
Configuration menu - View commit details
-
Copy full SHA for 48d24da - Browse repository at this point
Copy the full SHA 48d24daView commit details -
erts: Fix system_info({allocator_sizes, mseg_alloc})
will now return [{instance,0,[{segments_size,9961472,9961472,11010048}]}, {instance,1,[{segments_size,6291456,6291456,6815744}]}, {instance,2,[{segments_size,524288,524288,786432}]}, {instance,3,[{segments_size,1048576,1048576,1835008}]}, {instance,4,[{segments_size,0,0,262144}]}] and not just empty lists.
Configuration menu - View commit details
-
Copy full SHA for 9f5fd83 - Browse repository at this point
Copy the full SHA 9f5fd83View commit details -
Configuration menu - View commit details
-
Copy full SHA for e75fdd3 - Browse repository at this point
Copy the full SHA e75fdd3View commit details
Commits on May 3, 2016
-
Configuration menu - View commit details
-
Copy full SHA for 9169589 - Browse repository at this point
Copy the full SHA 9169589View commit details
Commits on May 4, 2016
-
by (only) moving around stuff in the file. in order to make it easier to ifdef away all erts_mmap_* if not supported.
Configuration menu - View commit details
-
Copy full SHA for 067c234 - Browse repository at this point
Copy the full SHA 067c234View commit details -
erts: Add macro HAVE_ERTS_MMAP
and make erts_mmap unavailable at compile time if not supported.
Configuration menu - View commit details
-
Copy full SHA for dd5087b - Browse repository at this point
Copy the full SHA dd5087bView commit details -
This one: diameter_tcp.erl:928: (call) The call diameter_tcp:throttle({'timeout',_},#transport{socket::port() | {'sslsocket',_,_},parent::pid(),module::atom(),frag::binary() | {non_neg_integer(),non_neg_integer(),binary(),[binary()]},ssl::boolean() | [any()],timeout::'infinity' | non_neg_integer(),tref::'false' | reference(),flush::boolean(),throttle_cb::'false' | fun() | maybe_improper_list(fun() | maybe_improper_list(any(),[any()]) | {atom(),atom(),[any()]},[any()]) | {atom(),atom(),[any()]},throttled::'true' | binary()}) will never return since it differs in the 1st argument from the success typing arguments: ('discard' | 'ok' | binary() | pid() | {'discard' | 'ok' | binary() | pid(),'false' | fun() | [fun() | [any()] | {atom(),atom(),[any()]}] | {atom(),atom(),[any()]}},#transport{socket::port() | {'sslsocket',_,_},parent::pid(),module::atom(),frag::binary() | {non_neg_integer(),non_neg_integer(),binary(),[binary()]},ssl::boolean() | [any()],timeout::'infinity' | non_neg_integer(),tref::'false' | reference(),flush::boolean(),throttle_cb::'false' | fun() | [fun() | [any()] | {atom(),atom(),[any()]}] | {atom(),atom(),[any()]},throttled::binary()}) It's true that the clause doesn't return, because of the throw, and that's the intention.
Anders Svensson committedMay 4, 2016 Configuration menu - View commit details
-
Copy full SHA for 4709258 - Browse repository at this point
Copy the full SHA 4709258View commit details -
Configuration menu - View commit details
-
Copy full SHA for 03afaae - Browse repository at this point
Copy the full SHA 03afaaeView commit details -
Configuration menu - View commit details
-
Copy full SHA for 9791998 - Browse repository at this point
Copy the full SHA 9791998View commit details -
erts: Rename constants in enum erts_break_op
with uppercase for constants and why not call them 'RESTART' and 'PAUSE' as the API.
Configuration menu - View commit details
-
Copy full SHA for af2a4c5 - Browse repository at this point
Copy the full SHA af2a4c5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4a4475d - Browse repository at this point
Copy the full SHA 4a4475dView commit details -
erts: Remove multi scheduler blocking in match specs
for enable_trace and disable_trace operations. Instead seize needed locks while updating trace flags.
Configuration menu - View commit details
-
Copy full SHA for 3261d58 - Browse repository at this point
Copy the full SHA 3261d58View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8b2906d - Browse repository at this point
Copy the full SHA 8b2906dView commit details -
erts: Add matchspec restrictions for 'receive' trace
and non-call-trace. This is the easy way out to avoid difficult locking scenarios when accessing tracing flags on another process.
Configuration menu - View commit details
-
Copy full SHA for 5cb62b0 - Browse repository at this point
Copy the full SHA 5cb62b0View commit details -
erts: Add Sender in 'receive' trace matchspec
All 'EXIT' and monitor messages are sent from 'system' Timeouts are "sent" from 'clock_service'
Configuration menu - View commit details
-
Copy full SHA for 9627711 - Browse repository at this point
Copy the full SHA 9627711View commit details -
Configuration menu - View commit details
-
Copy full SHA for da75310 - Browse repository at this point
Copy the full SHA da75310View commit details -
Configuration menu - View commit details
-
Copy full SHA for 36e9d73 - Browse repository at this point
Copy the full SHA 36e9d73View commit details -
erts: Fix PAM to be callable from non-scheduler thread
also simplified the interface to to run PAM from trace
Configuration menu - View commit details
-
Copy full SHA for 14b81c6 - Browse repository at this point
Copy the full SHA 14b81c6View commit details -
Configuration menu - View commit details
-
Copy full SHA for d0ffd5c - Browse repository at this point
Copy the full SHA d0ffd5cView commit details -
erts: Fix bug in trace_pattern for 'on_load'
'on_load' is a call trace.
Configuration menu - View commit details
-
Copy full SHA for 6197aa2 - Browse repository at this point
Copy the full SHA 6197aa2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5417267 - Browse repository at this point
Copy the full SHA 5417267View commit details -
runtime_tools: Add dbg functions tpe/2 and ctpe/1
To set/clear match specs for send and receive trace. 'e' for Event as we might want to add match specs for other trace events (proc exit,link,ulink,...).
Configuration menu - View commit details
-
Copy full SHA for bc274db - Browse repository at this point
Copy the full SHA bc274dbView commit details -
Configuration menu - View commit details
-
Copy full SHA for e8fa9bb - Browse repository at this point
Copy the full SHA e8fa9bbView commit details -
Configuration menu - View commit details
-
Copy full SHA for 9265763 - Browse repository at this point
Copy the full SHA 9265763View commit details -
Configuration menu - View commit details
-
Copy full SHA for ce0e097 - Browse repository at this point
Copy the full SHA ce0e097View commit details -
Change dbg:ctpe to go back to default
i.e enable all send/receive trace.
Configuration menu - View commit details
-
Copy full SHA for d38d8a4 - Browse repository at this point
Copy the full SHA d38d8a4View commit details -
To return information about a single peer_ref(), to avoid having to retrieve more than is needed with service_info/2.
Anders Svensson committedMay 4, 2016 Configuration menu - View commit details
-
Copy full SHA for 2adc2c2 - Browse repository at this point
Copy the full SHA 2adc2c2View commit details -
To return a peer_fsm/transport pair given one of them.
Anders Svensson committedMay 4, 2016 Configuration menu - View commit details
-
Copy full SHA for 18449b6 - Browse repository at this point
Copy the full SHA 18449b6View commit details
Commits on May 6, 2016
-
Configuration menu - View commit details
-
Copy full SHA for 09d138e - Browse repository at this point
Copy the full SHA 09d138eView commit details
Commits on May 9, 2016
-
Merge branch 'xsipewe_gen_statem1' of https://github.com/xsipewe/otp …
…into raimo/polish-gen_statem/OTP-13065 Conflicts: lib/stdlib/doc/src/gen_statem.xml
Configuration menu - View commit details
-
Copy full SHA for 7ef564a - Browse repository at this point
Copy the full SHA 7ef564aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 1740546 - Browse repository at this point
Copy the full SHA 1740546View commit details -
Merge branch 'raimo/polish-gen_statem/OTP-13065'
* raimo/polish-gen_statem/OTP-13065: Fix all seealso and other minor changes Editorial update
Configuration menu - View commit details
-
Copy full SHA for 9f8c514 - Browse repository at this point
Copy the full SHA 9f8c514View commit details -
Configuration menu - View commit details
-
Copy full SHA for 22a1b43 - Browse repository at this point
Copy the full SHA 22a1b43View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8015bd8 - Browse repository at this point
Copy the full SHA 8015bd8View commit details -
mnesia_ext: Add create_external and increase protocol version to monitor
new protocol version to handle new schema fields
Configuration menu - View commit details
-
Copy full SHA for 7eec056 - Browse repository at this point
Copy the full SHA 7eec056View commit details -
mnesia_ext: Refactor record_validation code
Should maybe be moved to mnesia.erl and inlined?? Or is it used elsewhere?
Configuration menu - View commit details
-
Copy full SHA for 184175a - Browse repository at this point
Copy the full SHA 184175aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 66e9920 - Browse repository at this point
Copy the full SHA 66e9920View commit details -
mnesia_ext: Create schema functionality
Add ext to table/system information Add add_backend_type
Configuration menu - View commit details
-
Copy full SHA for 549555f - Browse repository at this point
Copy the full SHA 549555fView commit details -
Configuration menu - View commit details
-
Copy full SHA for c64fa62 - Browse repository at this point
Copy the full SHA c64fa62View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0469ff7 - Browse repository at this point
Copy the full SHA 0469ff7View commit details -
Configuration menu - View commit details
-
Copy full SHA for 81e90e8 - Browse repository at this point
Copy the full SHA 81e90e8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 08bfbfe - Browse repository at this point
Copy the full SHA 08bfbfeView commit details -
Configuration menu - View commit details
-
Copy full SHA for 3d13b01 - Browse repository at this point
Copy the full SHA 3d13b01View commit details -
mnesia_ext: Implement ext copies index
Make ram_copies index always use ordered_set And use index type as prefered type not a implementation requirement, the standard implmentation will currently ignore the prefered type.
Configuration menu - View commit details
-
Copy full SHA for 3aff647 - Browse repository at this point
Copy the full SHA 3aff647View commit details -
mnesia_ext: Create table/data containers from mnesia monitor not temp…
…orary processes Tables or data containers should be owned and monitored by mnesia_monitor and should thus be created by that process. Always create_table before loading it We need to create tables for ram_copies at least before loading them as they are intermittent. It is also needed to get mnesia monitor as the parent and supervisor of the data storage.
Configuration menu - View commit details
-
Copy full SHA for 545d88a - Browse repository at this point
Copy the full SHA 545d88aView commit details -
mnesia_ext: reuse snmp field for ext updates
Minimal impact when talking to older nodes.
Configuration menu - View commit details
-
Copy full SHA for 6fad79d - Browse repository at this point
Copy the full SHA 6fad79dView commit details -
Configuration menu - View commit details
-
Copy full SHA for e24275f - Browse repository at this point
Copy the full SHA e24275fView commit details -
Merge branch 'dgud/mnesia/ext-backend/PR-858/OTP-13058'
* dgud/mnesia/ext-backend/PR-858/OTP-13058: mnesia_ext: Add basic backend extension tests mnesia_ext: reuse snmp field for ext updates mnesia_ext: Create table/data containers from mnesia monitor not temporary processes mnesia_ext: Implement ext copies index mnesia_ext: Load table ext mnesia_ext: Dumper and schema changes mnesia_ext: Refactor mnesia_schema.erl mnesia_ext: Ext support in fragmented tables mnesia_ext: Backup handling mnesia_ext: Create schema functionality mnesia_ext: Add ext copies and db_fold to low level api mnesia_ext: Refactor record_validation code mnesia_ext: Add create_external and increase protocol version to monitor mnesia_ext: Add ext copies to records mnesia_ext: Add supervisor and behaviour modules
Configuration menu - View commit details
-
Copy full SHA for 387e94f - Browse repository at this point
Copy the full SHA 387e94fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7285415 - Browse repository at this point
Copy the full SHA 7285415View commit details -
Merge branch 'anders/diameter/test/OTP-13438'
* anders/diameter/test/OTP-13438: Don't assume list comprehension evaluation order
Anders Svensson committedMay 9, 2016 Configuration menu - View commit details
-
Copy full SHA for 4d6d523 - Browse repository at this point
Copy the full SHA 4d6d523View commit details -
Merge branch 'anders/diameter/overload/OTP-13330'
* anders/diameter/overload/OTP-13330: Suppress dialyzer warning Remove dead case clause Let throttling callback send a throttle message Acknowledge answers to notification pids when throttling Throttle properly with TLS Don't ask throttling callback to receive more unless needed Let a throttling callback answer a received message Let a throttling callback discard a received message Let throttling callback return a notification pid Make throttling callbacks on message reception Add diameter_tcp option throttle_cb
Anders Svensson committedMay 9, 2016 Configuration menu - View commit details
-
Copy full SHA for a3f49cf - Browse repository at this point
Copy the full SHA a3f49cfView commit details -
Merge branch 'anders/diameter/info/OTP-13508'
* anders/diameter/info/OTP-13508: Add diameter:peer_find/1 Add diameter:peer_info/1
Anders Svensson committedMay 9, 2016 Configuration menu - View commit details
-
Copy full SHA for f46d8a7 - Browse repository at this point
Copy the full SHA f46d8a7View commit details -
Configuration menu - View commit details
-
Copy full SHA for d7e7284 - Browse repository at this point
Copy the full SHA d7e7284View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5ca152a - Browse repository at this point
Copy the full SHA 5ca152aView commit details
Commits on May 10, 2016
-
erts: Implement max_heap_size process flag
The max_heap_size process flag can be used to limit the growth of a process heap by killing it before it becomes too large to handle. It is possible to set the maximum using the `erl +hmax` option, `system_flag(max_heap_size, ...)`, `spawn_opt(Fun, [{max_heap_size, ...}])` and `process_flag(max_heap_size, ...)`. It is possible to configure the behaviour of the process when the maximum heap size is reached. The process may be sent an untrappable exit signal with reason kill and/or send an error_logger message with details on the process state. A new trace event called gc_max_heap_size is also triggered for the garbage_collection trace flag when the heap grows larger than the configured size. If kill and error_logger are disabled, it is still possible to see that the maximum has been reached by doing garbage collection tracing on the process. The heap size is defined as the sum of the heap memory that the process is currently using. This includes all generational heaps, the stack, any messages that are considered to be part of the heap and any extra memory the garbage collector may need during collection. In the current implementation this means that when a process is set using on_heap message queue data mode, the messages that are in the internal message queue are counted towards this value. For off_heap, only matched messages count towards the size of the heap. For mixed, it depends on race conditions within the VM whether a message is part of the heap or not. Below is an example run of the new behaviour: Eshell V8.0 (abort with ^G) 1> f(P),P = spawn_opt(fun() -> receive ok -> ok end end, [{max_heap_size, 512}]). <0.60.0> 2> erlang:trace(P, true, [garbage_collection, procs]). 1 3> [P ! lists:duplicate(M,M) || M <- lists:seq(1,15)],ok. ok 4> =ERROR REPORT==== 26-Apr-2016::16:25:10 === Process: <0.60.0> Context: maximum heap size reached Max heap size: 512 Total heap size: 723 Kill: true Error Logger: true GC Info: [{old_heap_block_size,0}, {heap_block_size,609}, {mbuf_size,145}, {recent_size,0}, {stack_size,9}, {old_heap_size,0}, {heap_size,211}, {bin_vheap_size,0}, {bin_vheap_block_size,46422}, {bin_old_vheap_size,0}, {bin_old_vheap_block_size,46422}] flush(). Shell got {trace,<0.60.0>,gc_start, [{old_heap_block_size,0}, {heap_block_size,233}, {mbuf_size,145}, {recent_size,0}, {stack_size,9}, {old_heap_size,0}, {heap_size,211}, {bin_vheap_size,0}, {bin_vheap_block_size,46422}, {bin_old_vheap_size,0}, {bin_old_vheap_block_size,46422}]} Shell got {trace,<0.60.0>,gc_max_heap_size, [{old_heap_block_size,0}, {heap_block_size,609}, {mbuf_size,145}, {recent_size,0}, {stack_size,9}, {old_heap_size,0}, {heap_size,211}, {bin_vheap_size,0}, {bin_vheap_block_size,46422}, {bin_old_vheap_size,0}, {bin_old_vheap_block_size,46422}]} Shell got {trace,<0.60.0>,exit,killed}
Configuration menu - View commit details
-
Copy full SHA for e146a3e - Browse repository at this point
Copy the full SHA e146a3eView commit details -
Configuration menu - View commit details
-
Copy full SHA for dc203f5 - Browse repository at this point
Copy the full SHA dc203f5View commit details -
Configuration menu - View commit details
-
Copy full SHA for dc30187 - Browse repository at this point
Copy the full SHA dc30187View commit details