<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Hi, </div><div><br></div><div>Are you saying that a process will be terminated regardless of how much actual memory we have within a system as a whole?</div><div><br></div><div>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?</div><div><br></div><div>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?</div><div><br></div><div>Kind reagards</div><div><br></div><div>V/</div><div><br></div><div><div><br></div><div><br><div><div>On 27 Apr 2016, at 9:12 AM, Lukas Larsson wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr">Hello everyone,<div><br></div><div>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.</div><div><br></div><div><a href="https://github.com/erlang/otp/pull/1032">https://github.com/erlang/otp/pull/1032</a><br></div><div><br></div><div>I'd appreciate feedback on the api and semantics of the functionality.</div><div><br></div><div>A simple example of the new functionality looks like this:</div><div><br></div><div><br></div><div><div><font face="monospace, monospace">1> spawn_opt(fun() -> lists:seq(1,10000) end, [{max_heap_size, #{size => 1024, kill => true, error_logger => true}}]).</font></div><div><font face="monospace, monospace"><0.66.0></font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">=ERROR REPORT==== 27-Apr-2016::09:08:26 ===</font></div><div><font face="monospace, monospace"> Process: <0.66.0> on node test@anon</font></div><div><font face="monospace, monospace"> Context: maximum heap size reached</font></div><div><font face="monospace, monospace"> Max heap size: 1024</font></div><div><font face="monospace, monospace"> Total heap size: 1219</font></div><div><font face="monospace, monospace"> Kill: true</font></div><div><font face="monospace, monospace"> Error Logger: true</font></div><div><font face="monospace, monospace"> GC Info: [{old_heap_block_size,376},</font></div><div><font face="monospace, monospace"> {heap_block_size,843},</font></div><div><font face="monospace, monospace"> {mbuf_size,0},</font></div><div><font face="monospace, monospace"> {recent_size,176},</font></div><div><font face="monospace, monospace"> {stack_size,0},</font></div><div><font face="monospace, monospace"> {old_heap_size,288},</font></div><div><font face="monospace, monospace"> {heap_size,232},</font></div><div><font face="monospace, monospace"> {bin_vheap_size,0},</font></div><div><font face="monospace, monospace"> {bin_vheap_block_size,46422},</font></div><div><font face="monospace, monospace"> {bin_old_vheap_size,0},</font></div><div><font face="monospace, monospace"> {bin_old_vheap_block_size,46422}]</font></div></div><div><br></div><div>Lukas</div></div>
_______________________________________________<br>erlang-questions mailing list<br><a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>http://erlang.org/mailman/listinfo/erlang-questions<br></blockquote></div><br></div></div></body></html>