Last active
September 27, 2021 08:54
-
-
Save vorce/08f5acb29d35da1ff465c1c0c11170e2 to your computer and use it in GitHub Desktop.
Show what's using memory
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
# 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