[erlang-questions] Preventing memory crashes

Benoit Chesneau bchesneau@REDACTED
Mon Nov 21 19:51:19 CET 2016


or the memory montitor in rabbitmq
On Mon, 21 Nov 2016 at 19:36, Roger Lipscombe <roger@REDACTED>
wrote:

> It sounds like the existing high memory alarm would be enough...?
>
> See http://erlang.org/doc/man/memsup.html
>
> On 21 November 2016 at 18:29, Lyn Headley <lheadley@REDACTED> wrote:
> > Erlangers,
> >
> > I am looking to write a process that makes sure my node does not run
> > out of memory and crash. What I would like is a function F that
> > returns a number that represents the amount of memory my node is
> > using. If that number gets above a threshold T, I will kill a process
> > (carefully and safely, possibly after dumping its ets table to disk).
> > After the process exits, I would immediately call the same function F
> > and see whether the number it returns is now less than my threshold T.
> > If not, kill another process, etc.
> >
> > Can I easily write this function F? Does the 'total' number from
> > erlang:memory serve my needs here? In particular, will it go down
> > immediately after I kill a process?
> >
> > Given a carefully chosen value for threshold T, and assuming no atoms
> > or binaries are being allocated, (heap data and ets tables are the
> > main drivers of memory use), will this strategy indeed prevent my node
> > from crashing as long as I kill processes faster than they can grow?
> >
> > Other thoughts?
> >
> > -Lyn
> > _______________________________________________
> > erlang-questions mailing list
> > erlang-questions@REDACTED
> > http://erlang.org/mailman/listinfo/erlang-questions
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20161121/d05377a8/attachment.htm>


More information about the erlang-questions mailing list