[erlang-questions] Max heap size

Lukas Larsson lukas@REDACTED
Wed Apr 27 09:12:33 CEST 2016


Hello everyone,

I recently opened up a new pull request on Github that adds a new
process_flag that can be used to limit the heap size of a process.

https://github.com/erlang/otp/pull/1032

I'd appreciate feedback on the api and semantics of the functionality.

A simple example of the new functionality looks like this:


1> spawn_opt(fun() -> lists:seq(1,10000) end, [{max_heap_size, #{size =>
1024, kill => true, error_logger => true}}]).
<0.66.0>

=ERROR REPORT==== 27-Apr-2016::09:08:26 ===
     Process:          <0.66.0> on node test@REDACTED
     Context:          maximum heap size reached
     Max heap size:    1024
     Total heap size:  1219
     Kill:             true
     Error Logger:     true
     GC Info:          [{old_heap_block_size,376},
                        {heap_block_size,843},
                        {mbuf_size,0},
                        {recent_size,176},
                        {stack_size,0},
                        {old_heap_size,288},
                        {heap_size,232},
                        {bin_vheap_size,0},
                        {bin_vheap_block_size,46422},
                        {bin_old_vheap_size,0},
                        {bin_old_vheap_block_size,46422}]

Lukas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20160427/e55944ba/attachment.htm>


More information about the erlang-questions mailing list