<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Apr 28, 2016 at 1:32 AM, Richard A. O'Keefe <span dir="ltr"><<a href="mailto:ok@cs.otago.ac.nz" target="_blank">ok@cs.otago.ac.nz</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
   Wouldn't it be more suitable to have a process flag that would<br>
   instruct the VM to send a specific message to the process once<br>
   particular heap size have been reached and let process decide what<br>
   to do about it?<br>
<br></span></blockquote><div><br></div><div>We could. I've yet to see a use-case for it though. The main problem is that if you involve another process you introduce latency in between the max_heap_size being triggered and the other process reacting to the problem, and by then it may be too late. By instructing the process to kill itself the user can know that the limit put on the process was not breached. </div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
> Part of the point of the max_heap_size is that the process should be killed<br>
> without having to do the potentially expensive garbage collection that is<br>
> about to come, which is only achievable through an untrappable exit signal.<br>
<br></span>
I don't understand this.  How can you determine how much heap a process<br>
really needs without doing a garbage collection?<div class="HOEnZb"><div class="h5"><br></div></div></blockquote><div><br></div><div>Feel free to ask for more details about how this is done if my answer in the other mail regarding the GC initialization phase was not clear enough.</div><div><br></div><div>Lukas</div></div></div></div>