[erlang-questions] how to debug memory leaks?

Max Lapshin max.lapshin@REDACTED
Wed Dec 8 21:11:08 CET 2010


I have a bit different situation:


(ems@REDACTED)19> lists:sum([element(2,process_info(P,memory)) || {_, P,
_, _} <- supervisor:which_children(ems_media_sup)]).
4196568120
(ems@REDACTED)20> [garbage_collect(P) || {_, P, _, _} <-
supervisor:which_children(ems_media_sup)].
[true,true,true,true,true,true,true,true,true,true,true,
 true,true,true,true,true,true,true,true,true,true,true,true,
 true,true,true,true,true,true|...]
(ems@REDACTED)11> lists:sum([element(2,process_info(P,memory)) || {_, P,
_, _} <- supervisor:which_children(ems_media_sup)]).
41555744


Garbage collection cleans 99% of process memory and top utility shows
me, that all these gigabytes are freed.

How should I interpret this information? I suppose, that server is
working not very fast because of high memory consumption and I want to
lower it.

Should I call garbage_collect manually or better setup some options
like fullsweep_after ?


More information about the erlang-questions mailing list