Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

recon_alloc memory function returns memory used more than physical memory of the VM #104

Open
amarBitMan opened this issue Apr 24, 2023 · 1 comment

Comments

@amarBitMan
Copy link

amarBitMan commented Apr 24, 2023

recon_alloc:set_unit(gigabyte).
recon_alloc:memory(used, max).
397.1961054801941
recon_alloc:memory(allocated, max).
411.4017143249512
free -h
               total        used        free      shared  buff/cache   available
Mem:            98Gi        71Gi        14Gi       419Mi        11Gi        24Gi
Swap:             0B          0B          0B
@ferd
Copy link
Owner

ferd commented Apr 24, 2023

This function just sums up the values reported by the VM's many allocators:

recon/src/recon_alloc.erl

Lines 207 to 214 in 9efec26

memory(used,Keyword) ->
lists:sum(lists:map(fun({_,Prop}) ->
container_size(Prop,Keyword,blocks_size)
end,util_alloc()));
memory(allocated,Keyword) ->
lists:sum(lists:map(fun({_,Prop}) ->
container_size(Prop,Keyword,carriers_size)
end,util_alloc()));

If there's a disagreement, it's either an consequence of very fast allocation and deallocation while the various allocators are probed, or an inconsistency between what the VM reports (which I'd push back to the OTP team) or the way the OS calculates it in its own reports.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants