Skip to content

Conversation

@YaSuenag
Copy link
Member

@YaSuenag YaSuenag commented Jan 6, 2026

We can extract heap dump from coredump with jhsdb jmap --binaryheap, but it does not contain HPROF_GC_ROOT_JAVA_FRAME. It means we cannot detect leaked object on thread stack.

I attached 2 images which I saw on Eclipse Memory Analyzer Tool (MAT). Heap dumps were created following options:

-Xmx256m -XX:+CrashOnOutOfMemoryError -XX:+HeapDumpOnOutOfMemoryError
heapdumponoutofmemoryerror

This image shows "thread overview" from the heapdump by -XX:+HeapDumpOnOutOfMemoryError. It reports OOME.main has large retained heap.

from-core

On the other hand, this image extracted by jhsdb jmap --binaryheap does not report it - leaked object is reported as unreachable objects.

heapDump.cpp in HotSpot dumps HPROF_GC_ROOT_JAVA_FRAME for each Java frames. SA should do that.

Essensially, we need to apply the fix in 290c5ba , however it fails with exception due to access oop in out of range. We need to fix the number of objects in expression stack like HotSpot. I fixed it in 0697df1 . And also I saw error relates to invokedynamic because ConstantPool in SA has not followed curre t HotSpot implementation. So I fixed it in a9c9e6c .

This change works fine with both interpreter and -Xcomp.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8374577: Heap dump from core does not contain HPROF_GC_ROOT_JAVA_FRAME (Bug - P4)

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/29058/head:pull/29058
$ git checkout pull/29058

Update a local copy of the PR:
$ git checkout pull/29058
$ git pull https://git.openjdk.org/jdk.git pull/29058/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 29058

View PR using the GUI difftool:
$ git pr show -t 29058

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/29058.diff

Using Webrev

Link to Webrev Comment

@YaSuenag YaSuenag changed the title Heap dump from core does not contain HPROF_GC_ROOT_JAVA_FRAME 8374577: Heap dump from core does not contain HPROF_GC_ROOT_JAVA_FRAME Jan 6, 2026
@bridgekeeper
Copy link

bridgekeeper bot commented Jan 6, 2026

👋 Welcome back ysuenaga! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Jan 6, 2026

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk openjdk bot added the serviceability serviceability-dev@openjdk.org label Jan 6, 2026
@openjdk
Copy link

openjdk bot commented Jan 6, 2026

@YaSuenag The following label will be automatically applied to this pull request:

  • serviceability

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the hotspot-gc hotspot-gc-dev@openjdk.org label Jan 7, 2026
@openjdk
Copy link

openjdk bot commented Jan 7, 2026

@YaSuenag hotspot-gc has been added to this pull request based on files touched in new commit(s).

@YaSuenag
Copy link
Member Author

YaSuenag commented Jan 7, 2026

/label remove hotspot-gc

@openjdk openjdk bot removed the hotspot-gc hotspot-gc-dev@openjdk.org label Jan 7, 2026
@openjdk
Copy link

openjdk bot commented Jan 7, 2026

@YaSuenag
The hotspot-gc label was successfully removed.

@YaSuenag YaSuenag marked this pull request as ready for review January 7, 2026 04:56
@openjdk openjdk bot added the rfr Pull request is ready for review label Jan 7, 2026
@mlbridge
Copy link

mlbridge bot commented Jan 7, 2026

Webrevs

@lmesnik
Copy link
Member

lmesnik commented Jan 7, 2026

@YaSuenag Can you please add/update jtreg test for this fix or explain in the bug/PR why it is not added.

@YaSuenag
Copy link
Member Author

YaSuenag commented Jan 7, 2026

@lmesnik
I added the test to ClhsdbDumpheap.java whether HPROF_GC_ROOT_JAVA_FRAME is included in heap dump.

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

Labels

rfr Pull request is ready for review serviceability serviceability-dev@openjdk.org

Development

Successfully merging this pull request may close these issues.

2 participants