-
-
Save snaiper80/16e4d448d48c34703b76 to your computer and use it in GitHub Desktop.
Revisions
-
ferd created this gist
Jul 18, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,16 @@ f(MostLeaky). MostLeaky = fun(N) -> lists:sublist( lists:usort( fun({K1,V1},{K2,V2}) -> {V1,K1} =< {V2,K2} end, [try {_,Pre} = erlang:process_info(Pid, binary), erlang:garbage_collect(Pid), {_,Post} = erlang:process_info(Pid, binary), {Pid, length(Post)-length(Pre)} catch _:_ -> {Pid, 0} end || Pid <- processes()]), N) end. %% Pairs = MostLeaky(25).