<p><span style="font-family: sans-serif;">Hi,</span></p>
<p><span style="font-family: sans-serif;">you can tell OOM to not kill some process . for heart, somewhere in your start script do :</span></p>
<p> </p>
<p><span style="font-family: sans-serif;">pgrep -f "heart -pid" | while read PID; do echo -17 > /proc/$PID/oom_adj; done</span></p>
<p><span style="font-family: sans-serif;"> </span></p>
<p><span style="font-family: sans-serif;">-17 is the value to let OOM ignore the process.<br /></span></p>
<p><span style="font-family: sans-serif;"> </span></p>
<p><span style="font-family: sans-serif;">regards<br /></span></p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<blockquote style="padding-left: 5px; margin-left: 5px; border-left: #ff0000 2px solid;">> Message du 28/06/17 12:58<br />> De : "Magnus Henoch" <magnus@erlang-solutions.com><br />> A : "Sanath Prasanna" <ahe.sanath@gmail.com><br />> Copie à : "erlang-questions" <erlang-questions@erlang.org><br />> Objet : Re: [erlang-questions] beam is crashed due to out of memory & it is not started automatically after that even used heart<br />> <br />> Sanath Prasanna <ahe.sanath@gmail.com> writes:<br />> <br />> > Hi all, My system is going down due to out of memory & it is not <br />> > auto started even set -heart command in starting. What is the <br />> > reason for this ? Can someone explain how to overcome this <br />> > problem. (not starting system automatically using heart) Br, <br />> > Robert <br />> > <br />> > /var/log/message <br />> > <br />> > aa_hub kernel: [60952995.574233] Out of memory: Kill process <br />> > 2480 (beam.smp) score 498 or sacrifice child Jun 27 13:31:07 <br />> > aa_hub kernel: [60952995.577670] Killed process 2565 (heart) <br />> > total-vm:8408kB, anon-rss:92kB, file-rss:0kB Jun 27 13:31:07 <br />> > aa_hub kernel: [60952995.584754] epmd invoked oom-killer: <br />> > gfp_mask=0x201da, order=0, oom_score_adj=0 Jun 27 13:31:07 <br />> > aa_hub kernel: [60952995.587996] epmd cpuset=/ mems_allowed=0 <br />> > <br />> > startup command <br />> > <br />> > /system/bin/run_erl -daemon /system/test/pipe/ /tmp <br />> > "/system/bin/start_erl /system /system /system/bin/start_erl <br />> > -smp auto* -heart -*sname test +64 +P10000 +B i -setcookie test" <br />> <br />> I've seen the same issue. The problem is that the OOM killer <br />> identifies a process to kill, and then kills all its child <br />> processes before killing the chosen process itself. Since heart <br />> is a child process of the beam process, it doesn't have a chance <br />> to restart the Erlang VM.<br />> <br />> I tried to fix it with the patch below, but it didn't work for <br />> some reason - I don't remember the details. I ended up solving <br />> the problem by addressing the memory usage itself.<br />> <br />> https://github.com/legoscia/otp/commit/bc19687664697dcff9d5472e14da231cf830abe5<br />> <br />> Regards,<br />> Magnus<br />> <br />> _______________________________________________<br />> erlang-questions mailing list<br />> erlang-questions@erlang.org<br />> http://erlang.org/mailman/listinfo/erlang-questions<br />> </blockquote>