Created
September 12, 2014 22:46
-
-
Save blt/2ad5a2c8d955c6b0296d to your computer and use it in GitHub Desktop.
This file contains 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 characters
lists:reverse(lists:sort([{(MemWords * erlang:system_info(wordsize)) / math:pow(1000, 2), Tables, Pid} || {Pid, Tables, MemWords} <- lists:foldl(fun({Pid, Tab, MemWords}, [{Pid, TabList, TotMemWords} | Rest]) -> [{Pid, [Tab | TabList], TotMemWords + MemWords} | Rest]; (Elem, Acc) -> [Elem | Acc] end, [], lists:sort([{ets:info(E, owner), E, ets:info(E, memory)} || E <- ets:all()]))])). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment