Bug 452800 - Ability to set manual snapshots from signal
Summary: Ability to set manual snapshots from signal
Status: REPORTED
Alias: None
Product: Heaptrack
Classification: Applications
Component: general (other bugs)
Version First Reported In: unspecified
Platform: Other Linux
: NOR wishlist
Target Milestone: ---
Assignee: Milian Wolff
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-04-20 14:35 UTC by Guillaume Desmottes
Modified: 2022-04-22 13:44 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Guillaume Desmottes 2022-04-20 14:35:42 UTC
The DATA segment of my application keeps growing when I do some tasks. Ideally I'd like to be able to do something like this to help me debug it:

- Send a signal (such as `SIGUSR1`) to trigger a snapshot from heaptrack.
- Interact with my app to reproduce the problem.
- Send another signal to trigger a second snapshot.
- Be able somehow to see the memory which have been allocated (and not freed) between these two snapshots.

Does this make sense?

I implemented something similar in GStreamer's leaks tracer (see https://gitlab.freedesktop.org/gstreamer/gstreamer/-/blob/main/subprojects/gstreamer/plugins/tracers/gstleaks.c#L810 ) and it's been quite useful.
Comment 1 Milian Wolff 2022-04-20 21:50:11 UTC
heaptrack now allows filtering on the time axis of the charts. I think adding custom markers there to better allow figuring out where to filter is a great idea! I'm not so fond though of writing to different files or such to create different snapshots.

patches welcome :)
Comment 2 Guillaume Desmottes 2022-04-21 08:25:21 UTC
> heaptrack now allows filtering on the time axis of the charts.

So is there a way to filter to only display the allocated and not freed memory in a specific time interval?
I didn't find any way to do that in heaptrack_gui.

> I think adding custom markers there to better allow figuring out where to filter is a great idea! I'm not so fond though of writing to different files or such to create different snapshots.

Agreed, I think custom markers would be enough then.
Comment 3 Milian Wolff 2022-04-22 13:44:15 UTC
See https://www.kdab.com/heaptrack-v1-3-0-release/ that shows a screenshot with the filtering active.

The range basically selects two time slices and when you apply that filter, the tables and flamegraph will show the delta between those two time slices.