<div dir="ltr">Thanks a lot, Lukas.<div>I was suspecting something like that but forgot to check it somehow.<br><div>It looks you are right here and problem seems to be in ssl_otp_session_cache table - we started do a lot of ssl requests.</div>
<div><br></div><div>Regards,</div><div>Kirill.</div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-05-28 12:26 GMT+04:00 Lukas Larsson <span dir="ltr"><<a href="mailto:lukas@erlang-solutions.com" target="_blank">lukas@erlang-solutions.com</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hello,<div><br></div><div>Binaries can also be present in ets objects and messages in processes' message queues. I'm sure there are some other places as well, but those should be the major ones.</div>

<div><br></div><div>I know of no easy way (with gdb or otherwise) to get information if this is the case. </div><div><div class="gmail_extra"><br>Lukas<br><div class="gmail_quote"><div><div class="h5">On Wed, May 28, 2014 at 9:07 AM, Kirill Zaborsky <span dir="ltr"><<a href="mailto:qrilka@gmail.com" target="_blank">qrilka@gmail.com</a>></span> wrote:<br>

</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr"><div>Hello,</div><div>I have recently found some memory "leak" in our application. Leak is in quotes because memory load seems to be constant under constant load. But the problem is that I see some extra binaries for which there are no signs in process_info.</div>


<div>In production we use our fork of OTP16BR3-1 (including some number of httpc fixes) but it looks like that behaviour could be reproduced locally on my machine with OTP 17.</div><div>I have tried to get any hints from recon but with not success.</div>


<div>The problem could be seen from the following Erlang shell lines:</div><div>-------------</div><div><div>(node@qrilka.local)87> recon:bin_leak(20),erlang:memory().</div><div>[{total,30574120},</div><div> {processes,6765096},</div>


<div> {processes_used,6738520},</div><div> {system,23809024},</div><div> {atom,662409},</div><div> {atom_used,652067},</div><div> {binary,145760},</div><div> {code,16742599},</div><div> {ets,1037976}]</div><div>(node@qrilka.local)88> lists:sum([N||{P1,N,B}<-[{P,lists:sum([S||{_,S,_}<-B]),B} || {P,{binary,B}} <- [{Pid,(catch process_info(Pid,binary))} || Pid <- processes()]]]).</div>


<div>17671</div><div>(node@qrilka.local)89> </div></div><div>-------------</div><div>As you see erlang:memory/0 shows 146k of memory used by binaries but erlang:process_info/2 shows information only about 18k</div><div>


Is there any way I could find out where the missing 128k of memory is?</div><div>Is it possible to get all binaries contents without gowing to some low-level tools like gdb (I'm not quite familiar with it yet)?</div>

<div>
Possibly there are some system-level binaries?</div><div>In production I see not kilobytes but hunderds of megabytes and sometimes it leads even to OOM crashes.</div><div>I run Gentoo on my desktop and in production we use Ubuntu Precise.</div>


<div>Thanks for any advice.</div><div><br></div>Best regards,<div>Kirill Zaborsky</div></div>
<br></div></div>_______________________________________________<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" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
<br></blockquote></div><br></div></div></div>
</blockquote></div><br></div>