<div dir="ltr">Thanks everybody for your help, I will try your suggestions.<br></div><div class="gmail_extra"><br><div class="gmail_quote">2015-07-17 1:44 GMT+01:00 David Leach <span dir="ltr"><<a href="mailto:dleach@wetafx.co.nz" target="_blank">dleach@wetafx.co.nz</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">You could always try invoke OOM manually once memory has been used up. If sysrq trigger is enabled<br>
Alt + SysRq/PrintScreen + f<br>
<br>
or if supported on your system<br>
<br>
os:cmd("echo b > /proc/sysrq-trigger")<br>
<br>
However, it doesn't guarantee it's going to kill your process, just that it will kill something. See <a href="http://unix.stackexchange.com/questions/153585/how-oom-killer-decides-which-process-to-kill-first" rel="noreferrer" target="_blank">http://unix.stackexchange.com/questions/153585/how-oom-killer-decides-which-process-to-kill-first</a><br>
<br>
<br>
<br>
________________________________________<br>
From: <a href="mailto:erlang-questions-bounces@erlang.org">erlang-questions-bounces@erlang.org</a> <<a href="mailto:erlang-questions-bounces@erlang.org">erlang-questions-bounces@erlang.org</a>> on behalf of Jon Schneider <<a href="mailto:jon@axismilton.ltd.uk">jon@axismilton.ltd.uk</a>><br>
Sent: Thursday, 16 July 2015 12:07 a.m.<br>
To: Daniil Churikov<br>
Cc: erlang questions<br>
Subject: Re: [erlang-questions] How to reproduce OOM.<br>
<span class=""><br>
The OOM killer is not a reliable thing and changes with the wind.<br>
<br>
If you want a ceiling on memory how about using ulimit possibly from the<br>
shell before starting beam ?<br>
<br>
Jon<br>
<br>
<br>
</span>> Hello Dániel. Thanks for your suggestions, although it indeed creates<br>
<span class="im HOEnZb">> memory allocation error,<br>
> it does not do what I need.<br>
> I want VM to be killed, but don't want to do it by myself. I am seeking<br>
> for<br>
> OOM killer's help,<br>
> if you know what I mean ;)<br>
><br>
</span><div class="HOEnZb"><div class="h5">> 2015-07-15 12:24 GMT+01:00 Dániel Szoboszlay <<a href="mailto:dszoboszlay@gmail.com">dszoboszlay@gmail.com</a>>:<br>
><br>
>> This one works for me quite reliably:<br>
>><br>
>> Eshell V5.10.4.0.1  (abort with ^G)<br>
>> 1> <<1:8000000000000>>.<br>
>><br>
>> Crash dump was written to: erl_crash.dump<br>
>> binary_alloc: Cannot allocate 1000000000031 bytes of memory (of type<br>
>> "binary").<br>
>> Aborted (core dumped)<br>
>><br>
>><br>
>> 2015-07-15 13:18 GMT+02:00 Daniil Churikov <<a href="mailto:ddosia@gmail.com">ddosia@gmail.com</a>>:<br>
>><br>
>>> Recently I was searching for robust way to restart elang VM in case of<br>
>>> sudden<br>
>>> stop (like crash or OOM).<br>
>>> And I found rather difficult to reproduce OOM conditions: I was trying<br>
>>> to<br>
>>> create<br>
>>> gigantic list of integers, so VM would be killed.<br>
>>> I did this:<br>
>>><br>
>>> L1 = [I || I <- lists:seq(1, 1000)].<br>
>>> L2 = [L1 || _ <- lists:seq(1, 1000)].<br>
>>> L3 = [L2 || _ <- lists:seq(1, 1000)]. % here VM hangs<br>
>>><br>
>>> But according to syslog it doesn't look like OOM death, I can't see<br>
>>> usual<br>
>>> log<br>
>>> entries like "Out of memory: Kill process 3855 (beam.smp) score 909 or<br>
>>> sacrifice<br>
>>> child" and others.<br>
>>><br>
>>> My current understanding is I asked more memory then I allowed to ask,<br>
>>> and b/c<br>
>>> OS is not willing to give this memory, erlang VM hangs.<br>
>>><br>
>>> If somebody have ideas how to reproduce OOM I would appreciate for<br>
>>> sharing.<br>
>>><br>
>>> Thanks!<br>
>>><br>
>>> _______________________________________________<br>
>>> erlang-questions mailing list<br>
>>> <a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
>>> <a href="http://erlang.org/mailman/listinfo/erlang-questions" rel="noreferrer" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
>>><br>
>>><br>
>><br>
> _______________________________________________<br>
> erlang-questions mailing list<br>
> <a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
> <a href="http://erlang.org/mailman/listinfo/erlang-questions" rel="noreferrer" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
><br>
<br>
_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" rel="noreferrer" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" rel="noreferrer" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
</div></div></blockquote></div><br></div>