Skip to content

Add heaptrack support #7764

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

Merged
merged 3 commits into from
Jul 21, 2025
Merged

Add heaptrack support #7764

merged 3 commits into from
Jul 21, 2025

Conversation

michaelsproul
Copy link
Member

@michaelsproul michaelsproul commented Jul 21, 2025

Proposed Changes

Although we're working on jemalloc profiler support in #7746, heaptrack seems to be producing more sensible results.

This PR adds a heaptrack profile and a heaptrack feature so that we no longer need to patch the code in order to use heaptrack. This may prove complementary to jemalloc profiling, so I think there is no harm in having both.

Additional Info

Usage:

FEATURES=heaptrack PROFILE=release-debug make

Then heaptrack lighthouse ... using the lighthouse binary that was just built.

@michaelsproul michaelsproul added the ready-for-review The code is ready for review label Jul 21, 2025
Cargo.toml Outdated
@@ -289,5 +289,9 @@ panic = "abort"
codegen-units = 1
overflow-checks = true

[profile.heaptrack]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could call this profile something else if we want to reuse it with jemalloc?

Maybe release-debug?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the overhead for having heaptrack high?
I think having a mode that runs release with just debug symbols without anything else, and having the option to add heaptrack + jemalloc profiling would be useful - so maybe having them as feature would be good enough?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

release-debug sounds good to me!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's virtually no overhead for compiling a binary with release-debug and features=heaptrack, except that we lose out on the efficiencies of jemalloc for tree-states. Running under heaptrack is a separate action, which does add quite a bit of overhead in terms of CPU

@michaelsproul michaelsproul requested a review from jimmygchen July 21, 2025 01:04
Copy link
Member

@jimmygchen jimmygchen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jimmygchen jimmygchen added ready-for-merge This PR is ready to merge. and removed ready-for-review The code is ready for review labels Jul 21, 2025
@mergify mergify bot merged commit 4a3e248 into unstable Jul 21, 2025
34 checks passed
@mergify mergify bot deleted the heaptrack branch July 21, 2025 02:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-merge This PR is ready to merge.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants