[erlang-questions] Memory leak related to "driver_alloc"

Florian Odronitz florian.odronitz@REDACTED
Wed May 2 19:08:34 CEST 2018


Hi,

I am trying to debug what looks like a memory leak of about 6GB per week (~10kB/s).
The node in question gets data from Kafka and Redis, processes it and puts the result back in Redis (~1MB/s in, 0.9MB/s out).

When I log into the node I see erlang:memory() reporting 14,6 GB of memory basically all attributed to "system".
Digging deeper recon_alloc:memory(allocated_types) finds that basically all the memory is allocated by "driver_alloc".

I tried a few things that did not change anything:
- force GC on all processes
- restart the main application
- stop all applications except the bare minimum

I thought maybe it is NIFs leaking memory so I tried to run them in isolation for around 30 CPU minutes each encoding/decoding or compressing/decompressing. They all seem fine.
Here is a list of them:
snappy: https://github.com/fdmanana/snappy-erlang-nif <https://github.com/fdmanana/snappy-erlang-nif>(c4cd1bb35f3a3a399737d64bd03b479817b90e75)
jsonx:  https://github.com/odo/jsonx <https://github.com/odo/jsonx> (435fc3e9df5c33bf307fa8c95da7a18b07ea49a7)
lz4:    https://github.com/szktty/erlang-lz4.git <https://github.com/szktty/erlang-lz4.git> (bdbfbedc89c073cd154de5a0691a198be43c539b)

I don't fully understand what driver_alloc contains and what could drive its growth.
Any thoughts?

Thanks, Florian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20180502/eb0b59f7/attachment.htm>


More information about the erlang-questions mailing list