Skip to content

Fix IEx.Helpers.process_info/1 heap and stack memory calculation#15628

Merged
josevalim merged 1 commit into
elixir-lang:mainfrom
AlexGx:ag-process_info_mem-fix
Jul 17, 2026
Merged

Fix IEx.Helpers.process_info/1 heap and stack memory calculation#15628
josevalim merged 1 commit into
elixir-lang:mainfrom
AlexGx:ag-process_info_mem-fix

Conversation

@AlexGx

@AlexGx AlexGx commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Fix :total_heap_size, :heap_size, :stack_size displayed in wrong units, :erlang.process_info/2 returns it
in VM's word size.

iex> pid = spawn(fn -> receive do after :infinity -> nil end end)
iex> process_info(pid)

# Process #PID<0.110.0>

...

## Memory 

Memory               2 KB
Total heap size      233 B
Heap size            233 B
Stack size           9 B

Here 233, 233, and 9 are words

References
https://www.erlang.org/doc/apps/erts/erlang.html#process_info/2
https://www.erlang.org/doc/apps/erts/garbagecollection.html#sizing-the-heap

@josevalim
josevalim merged commit 92648c7 into elixir-lang:main Jul 17, 2026
15 checks passed
@josevalim

Copy link
Copy Markdown
Member

💚 💙 💜 💛 ❤️

@AlexGx
AlexGx deleted the ag-process_info_mem-fix branch July 17, 2026 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants