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

[pprof] - Save heap profile to the file on Shutdown #36576

Closed
VihasMakwana opened this issue Nov 27, 2024 · 6 comments
Closed

[pprof] - Save heap profile to the file on Shutdown #36576

VihasMakwana opened this issue Nov 27, 2024 · 6 comments
Labels
enhancement New feature or request extension/pprof

Comments

@VihasMakwana
Copy link
Contributor

Component(s)

extension/pprof

Is your feature request related to a problem? Please describe.

Currently, there is no straightforward way to get heap profile of the collector right before it gets terminated. Same functionality exists for CPU.
It would be highly beneficial to have the ability to write the heap profile to a file at that point.

Describe the solution you'd like

runtime/pprof has a function, WriteHeapProfile, that saves current heap profile to the file. We can introduce a config for this, similar to what we do for CPU profile.

Describe alternatives you've considered

No response

Additional context

No response

@VihasMakwana VihasMakwana added enhancement New feature or request needs triage New item requiring triage labels Nov 27, 2024
@VihasMakwana VihasMakwana changed the title [pp [pprof] - Save heap profile to the file on Shutdown Nov 27, 2024
Copy link
Contributor

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@VihasMakwana
Copy link
Contributor Author

@MovieStoreGuy when you have a moment, can you take a look at it?

@atoulme atoulme removed the needs triage New item requiring triage label Dec 7, 2024
@atoulme
Copy link
Contributor

atoulme commented Dec 7, 2024

heap profile on shutdown? But everything is shut down then? What are you hoping to capture?

@VihasMakwana
Copy link
Contributor Author

VihasMakwana commented Dec 7, 2024

I think I misunderstood the shutdown sequence.
You're right. If we want to save heap profile, we need to save it right before shutdown and not in extension. The extensions are last in line when it comes to shutdown and all the relevant components will already be shut. I'll try to find an appropriate place for this feature.

@MovieStoreGuy
Copy link
Contributor

It sounds like you almost want Continuous Profiling_ or Always On Profiling which will take snapshots of the application throughout its lifetime.

@VihasMakwana
Copy link
Contributor Author

Yeah, kind of.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request extension/pprof
Projects
None yet
Development

No branches or pull requests

3 participants