Skip to content

Instantly share code, notes, and snippets.

@vorce

vorce/memory.ex

Last active Jun 15, 2019
Embed
What would you like to do?
Show what's using memory
# show top memory using processes
:erlang.processes()
|> Enum.map(fn pid ->
[:erlang.process_info(pid, :memory), :erlang.process_info(pid, :current_function)]
end)
|> Enum.sort()
|> Enum.reverse()
|> Enum.take(25)
# show top memory using ETS tables
:ets.all()
|> Enum.map(fn table ->
[memory: :ets.info(table, :memory), size: :ets.info(table, :size), name: :ets.info(table, :name)]
end)
|> Enum.sort()
|> Enum.reverse()
|> Enum.take(25)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.