[erlang-questions] Any guidance on tweaking allocator settings?
Thu Apr 7 22:28:16 CEST 2016
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
A very simple hack solved my problem (and that being a non-critical
application I don't really care bout the implications):
[garbage_collect(Pid) || Pid <- processes()].
I execute this every minute or so and my load tester never had the problem
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.
On Tue, Apr 5, 2016 at 2:58 PM, Fred Hebert <mononcqc@REDACTED> wrote:
> On 04/05, Lukas Larsson wrote:
>> If you use recon_alloc:memory(usage) on the snapshots you have you can see
>> you have a high usage percentage which means that you do not have any
>> memory fragmentation issues that tweaking the erts allocators would fix.
>> Your application is simply using a lot of memory and it seems to be
>> heap memory. I would recommend using observer to see which processes use a
>> lot of memory and from there try to figure out why.
> To add to this, I've got a full section on this stuff in Erlang in Anger (
> http://www.erlang-in-anger.com/). Look at Chapter 7 for memory issues,
> and 7.3 for a specific focus on allocators.
> That hopefully may prove helpful.
> erlang-questions mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions