[erlang-questions] Memory not freed after VM closed

tom kelly ttom.kelly@REDACTED
Fri Aug 16 13:20:07 CEST 2013

Hi Patrik, Motiejus,

Thanks for the expertise, that does indeed explain all our
observations. Writing that file does free up the RAM, and I love the
tone of linuxatemyram.com ;-)

Our application has to work in some tight HW specs so we have a
resource checker that monitors our RAM level among other things. When
RAM is low we take certain actions and send connections into a by-pass
mode which is sub-optimal but better than crashing from memory
starvation. This was being triggered too often on our deployment which
brought it to our attention.

Based on my new knowledge I can now program this better and use the
correct figure for RAM usage to base our decisions on. Hopefully a
customer will monitor top & I'll have an occasion to send them that

Thanks for the answers.


On 8/16/13, Motiejus Jakštys <desired.mta@REDACTED> wrote:
> On Fri, Aug 16, 2013 at 11:27 AM, tom kelly <ttom.kelly@REDACTED> wrote:
>> Hi list,
>> We're confused here by a memory usage problem that we're seeing. We're
>> writing a lot of data chunks to disk and are seeing higher than
>> expected memory usage, that lingers even after the Erlang VM has
>> stopped.
>> We're easily confused here at the best of times ;-) so if anyone can
>> shed any light on what's holding onto this RAM it'd be much
>> appreciated! Ideally we'd like to get this 300MB freed up straight
>> away after writing everything to disk.
> Hi, Tom,
> like Patrick said, probably it is disk cache by linux kernel. Run this
> to verify:
> $ echo 1 | sudo tee /proc/sys/vm/drop_caches
> This command instructs kernel to release disk cache. Inspect your
> memory after running this command and confirm.
> --
> Motiejus Jakštys

More information about the erlang-questions mailing list