[erlang-questions] Memory growing

Alex P sigxcpu@REDACTED
Sat Feb 2 22:11:21 CET 2013


Hi Dmitry,

Here is the output of the entop (as you can see, the processes are not the 
issue here, "system" section is):

Node: 'agstats@REDACTED' (Connected) (R15B03/5.9.3.1) unix 
(linux 3.2.0) CPU:16 SMP +A:0
Time: local time 13:09:10, up for 003:12:35:31, 0ms latency,
Processes: total 334 (RQ 0) at 52918 RpI using 49898.4k (49993.9k allocated)
Memory: Sys 264699.0k, Atom 892.0k/910.9k, Bin 1826.3k, Code 8097.1k, Ets 
474.5k

Interval 1000ms, Sorting on "Reductions" (Descending), Retrieved in 12ms
         Pid Registered Name      Reductions   MQueue HSize  SSize  
HTot                                                                             

   <0.326.0> -                    25014751303  0      10946  9      39603 
   <0.301.0> agstats_amqp_consume 1281607832   0      2584   9      3571
   <0.315.0> agstats_dispatcher   472013246    0      17711  9      18321
   <0.310.0> -                    210373059    0      987    9      1364
   <0.293.0> process_killer       197156469    0      1597   9      3194
0.7437.1563> -                    144466013    0      75025  9      150050
   <0.305.0> -                    122348400    0      1597   9      2207
   <0.316.0> agstats_snapshotter  101550524    0      2584   9      2961
   <0.299.0> agstats_db_mongo     100126516    0      10946  9      39603
   <0.331.0> -                    78832553     0      610    6      1220
   <0.325.0> -                    75253366     0      610    9      987
   <0.330.0> -                    71854078     0      987    9      1597
   <0.312.0> -                    68821776     0      2584   7      3571
   <0.313.0> -                    62769588     0      233    9      1220
   <0.322.0> -                    43514944     0      987    9      1364
.12614.1563> -                    24678619     0      46368  9      92736
    <0.82.0> timer_server         22905189     0      2584   9      2961
   <0.327.0> -                    22070516     0      610    9      1220

On Saturday, February 2, 2013 11:01:18 PM UTC+2, Dmitry Kolesnikov wrote:
>
> Hello,
>
> This is extremely hard to answer your question not knowing the application 
> context, what it does, etc.
> Just keep in mode that memory report is given in words with is either 4 or 
> 8 byte depends on system config. This is a reason why linux show diff 
> value. 
>
> I would start with entop utility and check top processes with high men and 
> high reductions.
> https://github.com/mazenharake/entop
>
> Please share those views!
>
> Best Regards, Dmitry
>
> On Feb 2, 2013, at 10:52 PM, Alexandru Pirvulescu <sig...@REDACTED<javascript:>> 
> wrote:
>
> Hello,
>
> If somebody could help me with an issue, I would be grateful. I'm pulling 
> my hair off trying to figure out why an erlang app keeps growing in memory 
> usage. The erlang:memory() after 3 days shows this:
>
> [{total,325732292},
>  {processes,54520269},
>  {processes_used,54492115},
> * {system,271212023},
> * {atom,932793},
>  {atom_used,912937},
>  {binary,2348080},
>  {code,8288354},
>  {ets,487392},
>  {maximum,398189416}]
>
> The interesting part is "system" section. All other data is fine 
> (processes goes to few MBs during the night as all the started procs are 
> either hibernated - for long running or they die because of inactivity).
>
> There are two issues here:
> - "system" keeps growing (around 800MB/week)
> - OS (Linux) shows a significantly different amount of memory usage 
> (almost 2x, 610MB resident in this case)
>
> The only case where I've managed to make "system" grow is by calling 
> erlang:monitor() multiple times. It grows with ~13K/call.
>
> Erlang release used is R15B03. 
>
> The questions are:
> - is there any hidden function to inspect all the active process monitors? 
> (as the single place where I use erlang:monitor looks fine. The spawned kid 
> does its job and dies, so the ref should be garbage collected).
> - is there any way to inspect "system" section and find out what it 
> contains? Looking at memory chunks in process map got me nowhere
>
> Thank you,
> Alex
>
>
> _______________________________________________
> erlang-questions mailing list
> erlang-q...@REDACTED <javascript:>
> http://erlang.org/mailman/listinfo/erlang-questions
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20130202/c646d243/attachment.htm>


More information about the erlang-questions mailing list