Skip to content

Commit

Permalink
Fix heap size to be in bytes (#87)
Browse files Browse the repository at this point in the history
erlang:process_info/recon:info returns (total_)heap_size in words
instead of bytes.
  • Loading branch information
gomoripeti authored Mar 20, 2022
1 parent 227829f commit 8d0d3ad
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/observer_cli_process.erl
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ render_worker(info, Type, Interval, Pid, TimeRef, RedQ, MemQ) ->
output_die_view(Pid, Type, Interval),
next_draw_view(info, Type, TimeRef, Interval, Pid, RedQ, MemQ);
_ ->
WordSize = erlang:system_info(wordsize),

RegisteredName = proplists:get_value(registered_name, Meta),
GroupLeader = proplists:get_value(group_leader, Meta),
Status = proplists:get_value(status, Meta),
Expand All @@ -65,8 +67,8 @@ render_worker(info, Type, Interval, Pid, TimeRef, RedQ, MemQ) ->
MemoryUsed = proplists:get_value(memory_used, ProcessInfo),
Memory = proplists:get_value(memory, MemoryUsed),
MessageQueueLen = proplists:get_value(message_queue_len, MemoryUsed),
HeapSize = proplists:get_value(heap_size, MemoryUsed),
TotalHeapSize = proplists:get_value(total_heap_size, MemoryUsed),
HeapSize = proplists:get_value(heap_size, MemoryUsed, 0) * WordSize,
TotalHeapSize = proplists:get_value(total_heap_size, MemoryUsed, 0) * WordSize,
GarbageCollection = proplists:get_value(garbage_collection, MemoryUsed),

Work = proplists:get_value(work, ProcessInfo),
Expand Down

0 comments on commit 8d0d3ad

Please sign in to comment.