-
Notifications
You must be signed in to change notification settings - Fork 6.2k
JDK-8316691: Heap dump: separate stack traces for mounted virtual threads #15869
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
Conversation
👋 Welcome back amenkov! A progress list of the required criteria for merging this PR into |
@alexmenkov The following labels will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command. |
Webrevs
|
test/hotspot/jtreg/serviceability/jvmti/vthread/HeapDump/VtreadInHeapDump.java
Outdated
Show resolved
Hide resolved
Is there anything to tell you which carrier thread is associated with which mounted VThread? |
The carrier and virtual threads are distinct and the HPROF format doesn't have record types to support associations like this. However, your question does make me wonder how it behaves when running with +ShowCarrierFrames. |
|
IFAIU +ShowCarrierFrames does not makes sense for "general" heap dump (like generated by "jcmd GC.heap_dump"). |
I wonder why the |
I used the same logic to split stack traces as ThreadStackTrace::dump_stack_at_safepoint (it was added with VT integration, it's used, for example by VM_ThreadDump). |
That's right. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fix looks good. (I looked at the test changes mostly.) The only question, if it makes sense to update the test to verify that heapdump works correctly without continuations.
@alexmenkov This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 232 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fix looks pretty good to me.
I've posted several nits though.
test/hotspot/jtreg/serviceability/jvmti/vthread/HeapDump/VThreadInHeapDump.java
Show resolved
Hide resolved
good point. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the update!
Looks good.
Thanks,
Serguei
/integrate |
Going to push as commit 2b8276a.
Your commit was automatically rebased without conflicts. |
@alexmenkov Pushed as commit 2b8276a. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
This is subtask of JDK-8299426: Heap dump does not contain virtual Thread stack references
The change:
ThreadDumper objects for all platform/carrier and mounted virtual threads are cached instead of ThreadStackTrace objects (they are created during HPROF_FRAME/HPROF_TRACE dumping, used lated for writing HPROF_GC_ROOT_THREAD_OBJ/HPROF_GC_ROOT_JAVA_FRAME/HPROF_GC_ROOT_JNI_LOCAL subrecords);
Testing - tier1-tier3, new test
Output of the test for VtreadInHeapDumpTarg$VthreadMounted thread
without the fix:
`thread 0x8101be90, 16 frames
Java Local Reference: VtreadInHeapDumpTarg$VthreadMounted
Java Local Reference: VtreadInHeapDumpTarg$VThreadMountedReferenced
Java Local Reference: java.lang.VirtualThread
Java Local Reference: java.lang.Class
Java Local Reference: VtreadInHeapDumpTarg$VthreadMounted
Java Local Reference: java.lang.VirtualThread
Java Local Reference: VtreadInHeapDumpTarg$VthreadMounted
Java Local Reference: java.lang.Class
Java Local Reference: java.lang.VirtualThread$VThreadContinuation$1
Java Local Reference: java.lang.VirtualThread$VThreadContinuation
Java Local Reference: java.lang.VirtualThread$VThreadContinuation
Java Local Reference: java.lang.VirtualThread$VThreadContinuation
Java Local Reference: jdk.internal.misc.CarrierThread
Java Local Reference: java.lang.VirtualThread
Java Local Reference: java.lang.VirtualThread$$Lambda+0x0000023001057a58
Java Local Reference: java.util.concurrent.ForkJoinTask$RunnableExecuteAction
Java Local Reference: java.util.concurrent.ForkJoinTask$RunnableExecuteAction
Java Local Reference: java.util.concurrent.ForkJoinPool$WorkQueue
Java Local Reference: java.util.concurrent.ForkJoinTask$RunnableExecuteAction
Java Local Reference: java.util.concurrent.ForkJoinPool$WorkQueue
Java Local Reference: java.util.concurrent.ForkJoinPool
Java Local Reference: java.util.concurrent.ForkJoinPool$WorkQueue
Java Local Reference: [Ljava.util.concurrent.ForkJoinPool$WorkQueue;
Java Local Reference: java.util.concurrent.ForkJoinPool$WorkQueue
Java Local Reference: [Ljava.util.concurrent.ForkJoinTask;
Java Local Reference: java.util.concurrent.ForkJoinTask$RunnableExecuteAction
Java Local Reference: java.util.concurrent.ForkJoinPool
Java Local Reference: java.util.concurrent.ForkJoinPool$WorkQueue
Java Local Reference: jdk.internal.misc.CarrierThread
Java Local Reference: java.util.concurrent.ForkJoinPool
Java Local Reference: java.util.concurrent.ForkJoinPool$WorkQueue`
with the fix:
`thread 0x8101c360, 6 frames
Java Local Reference: VtreadInHeapDumpTarg$VthreadMounted
Java Local Reference: VtreadInHeapDumpTarg$VThreadMountedReferenced
Java Local Reference: java.lang.VirtualThread
Java Local Reference: java.lang.Class
Java Local Reference: VtreadInHeapDumpTarg$VthreadMounted
Java Local Reference: java.lang.VirtualThread
Java Local Reference: VtreadInHeapDumpTarg$VthreadMounted
Java Local Reference: java.lang.Class
Java Local Reference: java.lang.VirtualThread$VThreadContinuation$1
Java Local Reference: java.lang.VirtualThread$VThreadContinuation
Java Local Reference:
java.lang.VirtualThread$VThreadContinuation
`thread 0x8101be90, 9 frames
Java Local Reference: java.lang.VirtualThread$VThreadContinuation
Java Local Reference: jdk.internal.misc.CarrierThread
Java Local Reference: java.lang.VirtualThread
Java Local Reference: java.lang.VirtualThread$$Lambda+0x000001fa96057a58
Java Local Reference: java.util.concurrent.ForkJoinTask$RunnableExecuteAction
Java Local Reference: java.util.concurrent.ForkJoinTask$RunnableExecuteAction
Java Local Reference: java.util.concurrent.ForkJoinPool$WorkQueue
Java Local Reference: java.util.concurrent.ForkJoinTask$RunnableExecuteAction
Java Local Reference: java.util.concurrent.ForkJoinPool$WorkQueue
Java Local Reference: java.util.concurrent.ForkJoinPool
Java Local Reference: java.util.concurrent.ForkJoinPool$WorkQueue
Java Local Reference: [Ljava.util.concurrent.ForkJoinPool$WorkQueue;
Java Local Reference: java.util.concurrent.ForkJoinPool$WorkQueue
Java Local Reference: [Ljava.util.concurrent.ForkJoinTask;
Java Local Reference: java.util.concurrent.ForkJoinTask$RunnableExecuteAction
Java Local Reference: java.util.concurrent.ForkJoinPool
Java Local Reference: java.util.concurrent.ForkJoinPool$WorkQueue
Java Local Reference: jdk.internal.misc.CarrierThread
Java Local Reference: java.util.concurrent.ForkJoinPool
Java Local Reference: java.util.concurrent.ForkJoinPool$WorkQueue`
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/15869/head:pull/15869
$ git checkout pull/15869
Update a local copy of the PR:
$ git checkout pull/15869
$ git pull https://git.openjdk.org/jdk.git pull/15869/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 15869
View PR using the GUI difftool:
$ git pr show -t 15869
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/15869.diff
Webrev
Link to Webrev Comment