memray
memray copied to clipboard
Implement plot of module usage over time
One of the aspects that makes memray
different from other similar tools is that we capture a ton of information from the running process. Currently, we mainly leverage this information to generate reports that happen at the process high water mark. This is likely the most interesting point for reporting, but we are not using a lot of the information that we collect. This information can be very useful to provide a different view of the program: how memory evolves over time. In this regard, we already offer total RSS and HEAP allocation over time but it would be great if we could break down that total in different pieces.
After some discussion with @godlygeek, we plan to experiment with this and start offering a way to break down the total usage by module. Here is a rough example of what that would look like:
Ideally, we can break down the chart in different ways:
- By module
- By function
- By file
As we don't want to collect timing information per allocation because that will increase the file size by a ridiculous amount (8 bytes or so per allocation) we will make time snapshots every time we emit one of the RSS ticks in the background thread. Is likely that we need to collapse those in a broader granularity because that's likely still too much.