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

[Request] Add option to trigger a heap dump #134

Open
lkonno opened this issue Oct 31, 2023 · 3 comments
Open

[Request] Add option to trigger a heap dump #134

lkonno opened this issue Oct 31, 2023 · 3 comments
Assignees
Labels
feat New feature or request

Comments

@lkonno
Copy link
Contributor

lkonno commented Oct 31, 2023

Describe the feature

Add option to trigger the heap dump capture remotely and retrieve the dump file. Currently, it is necessary to execute the jmap command inside the pod.

It can be helpful when the image does not include the jmap/jcmd tools.

HotSpotDiagnosticMXBean

Anything other information?

@lkonno lkonno added feat New feature or request needs-triage Needs thorough attention from code reviewers labels Oct 31, 2023
@andrewazores andrewazores removed the needs-triage Needs thorough attention from code reviewers label Jul 5, 2024
@andrewazores andrewazores moved this to Backlog in 4.0.0 release Jul 5, 2024
@Josh-Matsuoka Josh-Matsuoka self-assigned this Aug 28, 2024
@grzesuav
Copy link

Also interested in this feature, especially for container running with distroless images where there is no shell to even execute jmap/jcmd

@andrewazores
Copy link
Member

We are targeting this for the next major release (4.0), however it's likely that it will require the installation of the Cryostat Agent into your target application(s) in order to transfer the heap dump out from the target. Otherwise, we'd be able to remotely trigger the heap dump, but the dump file would remain stuck in the container's local filesystem.

@andrewazores
Copy link
Member

An interesting idea (needs proof of concept) would be to try creating a Unix domain socket:

https://inside.java/2021/02/03/jep380-unix-domain-sockets-channels/

https://github.com/kohlschutter/junixsocket

This way, /path/to/socket could possibly be given to the Diagnostic MXBean as the path to dump the hprof file. The Agent could be listening on this socket and piping data from the Unix socket to a network socket (HTTP connection) back to Cryostat. This way, we might be able to avoid writing to ephemeral container storage in tmpfs or similar, which could add some extra complexity (OOM or out-of-diskspace)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat New feature or request
Projects
Status: Backlog
Development

No branches or pull requests

4 participants