[erlang-questions] Max heap size

Valentin Micic v@REDACTED
Wed Apr 27 14:23:21 CEST 2016


Hi, 

Are you saying that a process will be terminated regardless of how much actual memory we have within a system as a whole?

Well, how useful would it be to kill a mission critical process just because it is using slightly more memory that we have originally envisaged?

Wouldn't it be more suitable to have a process flag that would instruct the VM to send a specific message to the process once particular heap size have been reached and let process decide what to do about it?

Kind reagards

V/



On 27 Apr 2016, at 9:12 AM, Lukas Larsson wrote:

> 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
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions

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


More information about the erlang-questions mailing list