Skip to content

Instantly share code, notes, and snippets.

@vorce
Last active Sep 27, 2021
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, :current_function, :current_location])
end)
|> Enum.sort_by(fn process_info -> process_info[:memory] end)
|> 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