Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions lib/iex/lib/iex/helpers.ex
Original file line number Diff line number Diff line change
Expand Up @@ -893,15 +893,17 @@ defmodule IEx.Helpers do
def process_info(pid) do
with pid when is_pid(pid) <- GenServer.whereis(pid),
info when is_list(info) <-
:erpc.call(node(pid), :erlang, :process_info, [pid, @process_info_keys]) do
:erpc.call(node(pid), :erlang, :process_info, [pid, @process_info_keys]),
word_size when is_integer(word_size) <-
:erpc.call(node(pid), :erlang, :system_info, [:wordsize]) do
info = Map.new(info)

IO.puts(IEx.color(:eval_result, ["\n# Process ", inspect(pid)]))

print_process_overview(info)
print_process_links(info[:links])
print_process_monitors(info[:monitors])
print_process_memory(info)
print_process_memory(info, word_size)
print_process_stacktrace(info[:current_stacktrace])
else
_ ->
Expand Down Expand Up @@ -957,11 +959,14 @@ defmodule IEx.Helpers do
end
end

defp print_process_memory(info) do
defp print_process_memory(info, word_size) do
print_pane("Memory")

for key <- [:memory, :total_heap_size, :heap_size, :stack_size] do
print_entry(@process_info_label_mapping[key], format_bytes(info[key]))
print_entry(@process_info_label_mapping[:memory], format_bytes(info[:memory]))

# InfoTuple's word-sized items
for key <- [:total_heap_size, :heap_size, :stack_size] do
print_entry(@process_info_label_mapping[key], format_bytes(info[key] * word_size))
end
end

Expand Down
Loading