[erlang-questions] Max heap size

Richard A. O'Keefe ok@REDACTED
Thu Apr 28 01:32:41 CEST 2016

On 28/04/16 1:12 AM, Lukas Larsson wrote:
 > The limit should be a guard against extreme memory usage growth,
 > not be a something you put very close to your normal maximum.
 > If you want to use this limit I suggest first running it with kill => 
 > and see what heap sizes gets reported to the error_logger and then
 > set the max_heap_size to an appropriately high value.

This must go into the documentation for the new flag.

    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?

 > You can build this using erlang:system_monitor(self(), [{large_heap, 
 > if you want to have it, or you could hook into the error_logger and react
 > to the messages sent by max_heap_size.

This also must go into the documentation.

 > Part of the point of the max_heap_size is that the process should be 
 > without having to do the potentially expensive garbage collection that is
 > about to come, which is only achievable through an untrappable exit 

I don't understand this.  How can you determine how much heap a process
really needs without doing a garbage collection?

More information about the erlang-questions mailing list