recon icon indicating copy to clipboard operation
recon copied to clipboard

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

Open amarBitMan opened this issue 2 years ago • 1 comments

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

amarBitMan avatar Apr 24 '23 08:04 amarBitMan

This function just sums up the values reported by the VM's many allocators: https://github.com/ferd/recon/blob/9efec263d84d0435230f4d3312a4afb352b8f71c/src/recon_alloc.erl#L207-L214

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.

ferd avatar Apr 24 '23 17:04 ferd