[erlang-questions] Erlang OTP 18 memory leak / SSL

Siraaj Khandkar <>
Tue Oct 6 15:04:36 CEST 2015


On Sat, Sep 19, 2015 at 2:34 PM, Siraaj Khandkar <>
wrote:

> On Sat, Sep 19, 2015 at 12:34 PM, Sereysethy TOUCH <
> > wrote:
>
>> Hello,
>>
>> I just recently updated Erlang to latest version OTP 18 on Ubuntu server.
>> It uses cowboy (websocket), ranch, ssl, erlydtl & rabbitmq. It used to work
>> fine in OTP 17. The program is correctly compiled but during the execution
>> the memory kept increasing. I need to restart the process every one or two
>> hours to free some memory.
>>
>> I have read a post here [
>> http://erlang.2086793.n4.nabble.com/R18-Unbounded-SSL-Session-ETS-Table-Growth-td4713697.html]
>> which discussed about the ssl_session_cache ETS table which can become very
>> large.
>>
>> The process beam.smp can go up to more than 5G during a few hours of
>> executions.
>>
>> I am not yet sure what is the root cause of this issue.
>>
>> Does anyone know how to fix this? Or where should I look at?
>>
>
>
> We just experienced the same after upgrading from 17.0 (leaking over
> days/weeks) to 17.5.3 (leaking over hours). I should be able to share some
> data in a few of days.
>

As promised, attached is a screenshot of memory usage (in bytes) before and
after upgrade to
18.1 (from 17.5, on Oct 2nd at 15:00ish). This is a machine with constant
load, that does not much
but poll over https every 15 seconds.

Top plot is total memory used by VM.

Middle is memory usage aggregated by process origin (name, if registered,
otherwise its spawn history (init call, otp init call, otp ancestry)).

Bottom is reductions per process origin (same schema as above).

Those, pre-18.1-upgrade, sharp drops are VM deaths (restarted by upstart).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20151006/4ad11748/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: screenshot--2015-10-05--18.41.30.jpg
Type: image/jpeg
Size: 183452 bytes
Desc: not available
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20151006/4ad11748/attachment-0001.jpg>


More information about the erlang-questions mailing list