Skip to content

feat(diagnostics): Add support for heap dump analysis#666

Draft
Josh-Matsuoka wants to merge 4 commits into
cryostatio:mainfrom
Josh-Matsuoka:heap-dump-analysis
Draft

feat(diagnostics): Add support for heap dump analysis#666
Josh-Matsuoka wants to merge 4 commits into
cryostatio:mainfrom
Josh-Matsuoka:heap-dump-analysis

Conversation

@Josh-Matsuoka

Copy link
Copy Markdown
Contributor

Related to: cryostatio/cryostat#1127

Adds preliminary support for Heap Dump analysis.

  • Embeds the JOverflow sources from JMC necessary to parse the heap dump files. These are part of application rather than core so aren't available on maven central so we need to take this approach.
  • Makes use of the JOverflow libraries to parse heap dumps and extract a number of analysis results from them. Roughly follows the analysis done by the ReportFormatter class, storing it in records that can be serialized easily for the frontend.
  • Collects some aggregate results as well as the reference chains needed to build the tables that JOverflow visualizes them as.
  • Adds an InterruptibleHeapDumpReportGenerator class that functions similarly to the InterruptibleReportGenerator class for performing the analysis on a separate thread.

Opening as draft pending any changes needed for the frontend.

@github-actions

github-actions Bot commented Apr 1, 2026

Copy link
Copy Markdown
ARCH IMAGE
amd64 ghcr.io/cryostatio/cryostat-core:pr-666-afe6df5da5e06441b9c655bcadc44e3ad0c7700b-linux

To run smoketest:

CRYOSTAT_IMAGE=ghcr.io/cryostatio/cryostat-core:pr-666-afe6df5da5e06441b9c655bcadc44e3ad0c7700b-linux bash smoketest.bash

"URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD",
"NP_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD"
})
public HeapDumpAnalysis(String heapDumpId, String jvmId, InputStream inputStream) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please refactor this so that all the work is not done directly in the constructor. Maybe make it Runnable and move the work off into that method, so that the constructor is only doing the basic necessities of validating the parameters and assigning fields etc.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I suppose if the heapDumpId and jvmId are removed then the only remaining parameter is the inputStream - but it's probably best that this is not passed in as a constructor field and assigned and then only later actually used in the "run" method.

So perhaps the best thing to do here is actually refactor this constructor into something like a public static HeapDumpAnalysis analyze(InputStream inputStream) throws IOException.

Comment thread cryostat-core/src/main/java/io/cryostat/core/diagnostic/HeapDumpAnalysis.java Outdated
Comment thread cryostat-core/src/main/java/io/cryostat/core/diagnostic/HeapDumpAnalysis.java Outdated
@andrewazores

Copy link
Copy Markdown
Member

@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown
ARCH IMAGE
amd64 ghcr.io/cryostatio/cryostat-core:pr-666-04eed805c07cbbf71e46188fd53765d6c59305fc-linux

To run smoketest:

CRYOSTAT_IMAGE=ghcr.io/cryostatio/cryostat-core:pr-666-04eed805c07cbbf71e46188fd53765d6c59305fc-linux bash smoketest.bash

@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown
ARCH IMAGE
amd64 ghcr.io/cryostatio/cryostat-core:pr-666-83e52a15a43db600189051d9b71bb4ccd1e143ee-linux

To run smoketest:

CRYOSTAT_IMAGE=ghcr.io/cryostatio/cryostat-core:pr-666-83e52a15a43db600189051d9b71bb4ccd1e143ee-linux bash smoketest.bash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat New feature or request safe-to-test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants