recon icon indicating copy to clipboard operation
recon copied to clipboard

recon_alloc:memory(usage) > 1 ?

Open walter-weinmann opened this issue 8 years ago • 3 comments

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.

walter-weinmann avatar Feb 01 '17 12:02 walter-weinmann

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.

ferd avatar Feb 01 '17 14:02 ferd

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

walter-weinmann avatar Feb 01 '17 14:02 walter-weinmann

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.

ferd avatar Feb 01 '17 15:02 ferd