<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On 3. May 2018, at 09:38, John Högberg <<a href="mailto:john.hogberg@ericsson.com" class="">john.hogberg@ericsson.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">On Wed, May 02, 2018 at 07:08:34PM +0200, Florian Odronitz wrote:<br class=""><blockquote type="cite" class="">When I log into the node I see erlang:memory() reporting 14,6 GB of<br class="">memory basically all attributed to "system".<br class="">Digging deeper recon_alloc:memory(allocated_types) finds that<br class="">basically all the memory is allocated by "driver_alloc".<br class=""></blockquote><br class="">If you can try out OTP 21-rc1, the new memory instrumentation features<br class="">will help you find the culprit:<br class=""><br class=""><a href="http://blog.erlang.org/Memory-instrumentation-in-OTP-21/" class="">http://blog.erlang.org/Memory-instrumentation-in-OTP-21/</a><br class=""></div></div></blockquote><div><br class=""></div><div>"Those who have used <code class="highlighter-rouge">erlang:memory()</code> are probably familiar with how annoyingly
general the <code class="highlighter-rouge">system</code> category can be. It’s possible to get a bit more
information by using <code class="highlighter-rouge">erlang:system_info({allocator, Alloc})</code> but the most it
will do is tell you that it’s (say) <code class="highlighter-rouge">driver_alloc</code> that eats all that memory
and leave you with no clue which one."</div><br class="">Thats my situation, exactly! Once Elixir is compatible, I will run one node under OTP 21 and then see if I can get some insight.</div><div><br class=""></div><div>Thanks for helping</div><div>Florian</div><div><br class=""></div><div><br class=""></div><div>PS: In the meanwhile I also looked at memory fragmentation using recon_alloc:fragmentation(current).</div><div>I found some impressive carriers (>4GB) but they seem to have very good usage.</div><div><div><br class=""></div><div>[{{:driver_alloc, 1},</div><div> [sbcs_usage: 1.0, mbcs_usage: 0.9999680067349549, sbcs_block_size: 0,</div><div> sbcs_carriers_size: 0, mbcs_block_size: 4937881312,</div><div> mbcs_carriers_size: 4938039296]},</div><div> {{:driver_alloc, 2},</div><div> [sbcs_usage: 1.0, mbcs_usage: 0.9998221050872671, sbcs_block_size: 0,</div><div> sbcs_carriers_size: 0, mbcs_block_size: 4819741224,</div><div> mbcs_carriers_size: 4820598784]},</div><div> {{:driver_alloc, 3},</div><div> [sbcs_usage: 1.0, mbcs_usage: 0.9999122383844911, sbcs_block_size: 0,</div><div> sbcs_carriers_size: 0, mbcs_block_size: 3822018976,</div><div> mbcs_carriers_size: 3822354432]},</div><div> {{:driver_alloc, 4},</div><div> [sbcs_usage: 1.0, mbcs_usage: 0.9967773040787262, sbcs_block_size: 0,</div><div> sbcs_carriers_size: 0, mbcs_block_size: 1326648648,</div><div> mbcs_carriers_size: 1330937856]},</div><div> {{:driver_alloc, 5},</div><div> [sbcs_usage: 1.0, mbcs_usage: 0.9775849991437053, sbcs_block_size: 0,</div><div> sbcs_carriers_size: 0, mbcs_block_size: 210428096,</div><div> mbcs_carriers_size: 215252992]},</div><div> {{:ll_alloc, 0},</div><div> [sbcs_usage: 1.0, mbcs_usage: 0.88204345703125, sbcs_block_size: 0,</div><div> sbcs_carriers_size: 0, mbcs_block_size: 34683360,</div><div> mbcs_carriers_size: 39321600]},</div></div><div><br class=""></div><div> <br class=""><blockquote type="cite" class=""><div class=""><div class=""><br class=""><blockquote type="cite" class="">I don't fully understand what driver_alloc contains and what could<br class="">drive its growth.<br class="">Any thoughts?<br class=""></blockquote><br class="">`driver_alloc` is used for general allocations in drivers and NIFs,<br class="">e.g. `enif_alloc()`, `erl_drv_thread_create()`, or<br class="">`enif_inspect_iovec()`.<br class=""><br class="">Regards,<br class="">John Högberg<br class="">_______________________________________________<br class="">erlang-questions mailing list<br class=""><a href="mailto:erlang-questions@erlang.org" class="">erlang-questions@erlang.org</a><br class="">http://erlang.org/mailman/listinfo/erlang-questions<br class=""></div></div></blockquote></div><br class=""></body></html>