Erlang - Question on memory usage reported

Rajesh Bhat <>
Wed Jun 16 14:55:00 CEST 2010


Hi All,

Apologies for the long email...

I am running an application that starts up with a memory footprint of around ~725MB when started (Approx 9000 processes on startup).. Application spawns processes as new requests are processed and grows to about 50K processes and memory usage of 5.1GB during the day. Output of memory(). is as follows -

memory().
[{total,5196843904},
 {processes,3676103336},
 {processes_used,3670262752},
 {system,1520740568},
 {atom,768433},
 {atom_used,743978},
 {binary,199344664},
 {code,8016451},
 {ets,1304839200}]

At the end of the day, a cleanup job reviews the process state and kills the pids that are not required and cleans up the ets table. Essentially returning it to start up stage of around 9K processes. Running the memory command in erlang shell reports -

memory().
[{total,721747840},
 {processes,584000792},
 {processes_used,552084576},
 {system,137747048},
 {atom,768433},
 {atom_used,744177},
 {binary,44468264},
 {code,8016451},
 {ets,80471216}]

Which is pretty consistent with what I am expecting, however running 'htop' on the system still indicates Erlang beam process with a resident memory usage of around 5.1GB. Any pointers that explains this behavior is greatly appreciated. Is there a way to release the memory? There was a suggestion in one of the Erlang forums that bouncing the Supervisor process as part of the clean up could be one of the options? Anyone with similar experience?

I am running the version - Erlang R13B02 (erts-5.7.3)

Thanks much
-- Rajesh Bhat.

______________________________________________

See  http://www.peak6.com/email_disclaimer.php
for terms and conditions related to this email


More information about the erlang-questions mailing list