Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement heatmap plot of allocation sizes over time #220

Open
pablogsal opened this issue Sep 28, 2022 · 0 comments
Open

Implement heatmap plot of allocation sizes over time #220

pablogsal opened this issue Sep 28, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@pablogsal
Copy link
Member

Following Brendan Gregg's webpage on performance visualizations we can try to implement a heatmap plot of memory allocation sizes over time. Here is an example of such heatmap (ignore the title as the heatmap is generated by reusing Brendan Gregg's utilities):

heatmap

The idea is that every vertical slice is a histogram of allocation sizes in a bucket that spans some time interval (normally the same time interval as we are using to take RSS snapshots). The plot shows therefore a collection of histograms over time. Check the docs for more information on how to read these.

Some points that @godlygeek raised over this default implementation:

the fact that it only shows allocations and not deallocations makes it easy to be misled by it, too, I think - since a straight line across the chart showing all the allocations are the same size wouldn't tell you anything about whether more memory is being used as time goes on. I'd almost want to see heap size plotted over top of it...

He then proposed the following:

What if we took the heat map idea, but made an allocation keep counting in every time interval until it is deallocated? So instead of a heat map of allocation sizes over time, it's a chart of allocated bytes over time broken down into size bands?
The changes is that instead of an allocation counting only for a single (x, y) cell on that chart, it counts for one x, multiple y - it keeps counting for every y from when it was allocated until it is deallocated
In this way, each row in the chart corresponds to some size range of allocations. Within each row, from left to right, we see every allocation that has occurred, and when it is freed. The more overlapping allocations there are at some point in time, the more saturated the colours on the chart are. This should basically just be taking the existing code, and making it so that

  • Each column starts as a copy of the previous column, and
  • Instead of ignoring deallocations, they remove a value from that column's data set (or, better yet, from the next one) (edited)

Following this idea we can modify the initial proposal to make a "heap size distribution plot over time" which is likely more useful than allocations over time.

@pablogsal pablogsal added the enhancement New feature or request label Sep 28, 2022
@pablogsal pablogsal added this to the Q4 2022 milestone Sep 28, 2022
@pablogsal pablogsal removed this from the Q4 2022 milestone Feb 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant