<div dir="ltr"><div><div><div><div><div><div>Hello,<br><br>I recently had the same problem in quite identical situation. In my case it was a load tester application that hammered onto a REST API. With several thousand bots when hitting a method that returns ~1M JSON, the VM started eating huge amounts of memory, until it crashed with out-of-memory exception.<br><br></div>A very simple hack solved my problem (and that being a non-critical application I don't really care bout the implications):<br><br></div>[garbage_collect(Pid) || Pid <- processes()].<br><br></div>I execute this every minute or so and my load tester never had the problem again.<br><br></div>I imagine somehow it failed to trigger full-sweep GC ever and generational GC never cleared the old parsed JSON terms allocated in the processes' heap. But as it solved my problem, I never dug any deeper.<br><br></div>Regards,<br></div>Metin<br><br><div><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Apr 5, 2016 at 2:58 PM, Fred Hebert <span dir="ltr"><<a href="mailto:mononcqc@ferd.ca" target="_blank">mononcqc@ferd.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 04/05, Lukas Larsson wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello,<br>
<br>
If you use recon_alloc:memory(usage) on the snapshots you have you can see<br>
you have a high usage percentage which means that you do not have any<br>
memory fragmentation issues that tweaking the erts allocators would fix.<br>
Your application is simply using a lot of memory and it seems to be process<br>
heap memory. I would recommend using observer to see which processes use a<br>
lot of memory and from there try to figure out why.<br>
<br>
</blockquote>
<br></span>
To add to this, I've got a full section on this stuff in Erlang in Anger (<a href="http://www.erlang-in-anger.com/" rel="noreferrer" target="_blank">http://www.erlang-in-anger.com/</a>). Look at Chapter 7 for memory issues, and 7.3 for a specific focus on allocators.<br>
<br>
That hopefully may prove helpful.<br>
<br>
Regards,<br>
Fred.<div class="HOEnZb"><div class="h5"><br>
_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org" target="_blank">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>