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(usage) > 1 ? #55

Open walter-weinmann opened 7 years ago

walter-weinmann commented 7 years ago

In 38 of 4258 cases, the result of this call is greater than 1. What can be the cause? The maximum value is 32.13506572.

ferd commented 7 years ago

The one reason I'd see for that is that there is memory allocation taking place between both calls. The usage call goes for the allocator data twice for ease of implementation: https://github.com/ferd/recon/blob/master/src/recon_alloc.erl#L226 I'm guessing this causes problems if you'Re not working from a snapshot.

walter-weinmann commented 7 years ago

Ok thanks - but can it then also be that values looking plausible (i.e. <= 1) are wrong ?

ferd commented 7 years ago

There's a chance, but I wouldn't expect the discrepancy to be too big unless you're trying the call on a VM that essentially does nothing but that call. The code could be reworked to make all calculations from a single snapshot.