ferd / recon

Collection of functions and scripts to debug Erlang in production.
http://ferd.github.io/recon/
BSD 3-Clause "New" or "Revised" License
1.36k stars 278 forks source link

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

Open amarBitMan opened 1 year ago

amarBitMan commented 1 year ago
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 commented 1 year ago

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.