Skip to content

Instantly share code, notes, and snippets.

@blt
Created September 12, 2014 22:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save blt/2ad5a2c8d955c6b0296d to your computer and use it in GitHub Desktop.
Save blt/2ad5a2c8d955c6b0296d to your computer and use it in GitHub Desktop.
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