Closed cao2358 closed 1 year ago
Hello @cao2358,
Thank you for reporting the issue! These are quite different measurements:
alloc_space
indicates memory allocated from the program start (cumulatively), like a prometheus counter.inuse_space
reports memory allocated on heap but not yet released, the value is instant, as a prometheus gauge.For convenience, Pyroscope server calculates deltas of alloc_*
profiles, but that requires two consecutive samples, therefore the difference in the screenshot is understood and expected if you've only sent just one profile. Also, please note that inuse_*
profiles are averaged, therefore the difference with alloc_*
profiles will be more and more prominent over time
Does this mean that the histogram for alloc* shows new allocations over the previous one? And inuse* represent the average memory usage?
Sorry for the delay!
Does this mean that the histogram for alloc* shows new allocations over the previous one? And inuse* represent the average memory usage?
alloc_*
show a sum of new allocations over the previous one. It is like if we applied Prometheus increase function.inuse_*
histograms show a sum of instant actual values. This is different to the aggregation of the flamegraph (which is average, indeed). This inconsistency might be misleading, however we believe that this is better for detecting memory leaks – an averaged graph is tend to "hide" gradually increasing values, therefore a memory leak would likely be unnoticed.If you don't mind I close the issue. Please feel free to re-open it if you have any questions
with version: v0.37.2 at my graph , the alloc_space is less than inuse_space , why ? for alloc_space vs inuse_space
here is a bug?