Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8321559 | na | Alex Menkov | P3 | Closed | Not an Issue |
ADDITIONAL SYSTEM INFORMATION :
Ubunu 22.10 x86_64
openjdk version "21-ea" 2023-09-19
OpenJDK Runtime Environment (build 21-ea+3-124)
OpenJDK 64-Bit Server VM (build 21-ea+3-124, mixed mode, sharing)
A DESCRIPTION OF THE PROBLEM :
HPROF files do not contain stack references of unmounted VirtualThreads. This would be necessary for all analyses based on reachability like biggest objects and dominator trees.
The HPROF file format generally supports variable-length HPROF_GC_INSTANCE_DUMP records so the references could be appended to the StackChunk dump.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
With the attached source, create a HPROF file and open it in a HPROF analyser that can show incoming references.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
There should be a reference to the VThreadReferenced instance.
ACTUAL -
There are no references to the VThreadReferenced instance.
---------- BEGIN SOURCE ----------
-- HprofVThreadStackRef.java ---------------------------------------------------------
import com.sun.management.HotSpotDiagnosticMXBean;
import java.io.File;
import java.lang.management.ManagementFactory;
import java.util.concurrent.CountDownLatch;
public class HprofVThreadStackRef {
public static void main(String[] args) throws Exception {
CountDownLatch dumpedLatch = new CountDownLatch(1);
Thread vthread = Thread.ofVirtual().start(() -> {
Object referenced = new VThreadReferenced();
System.out.println(referenced.getClass());
await(dumpedLatch);
System.out.println(referenced.getClass());
});
Thread.sleep(2000); // wait for reference and unmount
HotSpotDiagnosticMXBean hotSpotDiagnosticMXBean = ManagementFactory.getPlatformMXBean(HotSpotDiagnosticMXBean.class);
File hprofFile = new File("vthread_test.hprof");
hprofFile.delete();
hotSpotDiagnosticMXBean.dumpHeap(hprofFile.getPath(), true);
dumpedLatch.countDown();
vthread.join();
}
private static void await(CountDownLatch dumpedLatch) {
try {
dumpedLatch.await();
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
}
public static class VThreadReferenced {
}
}
--------------------------------------------------------------------------------------
---------- END SOURCE ----------
FREQUENCY : always
Ubunu 22.10 x86_64
openjdk version "21-ea" 2023-09-19
OpenJDK Runtime Environment (build 21-ea+3-124)
OpenJDK 64-Bit Server VM (build 21-ea+3-124, mixed mode, sharing)
A DESCRIPTION OF THE PROBLEM :
HPROF files do not contain stack references of unmounted VirtualThreads. This would be necessary for all analyses based on reachability like biggest objects and dominator trees.
The HPROF file format generally supports variable-length HPROF_GC_INSTANCE_DUMP records so the references could be appended to the StackChunk dump.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
With the attached source, create a HPROF file and open it in a HPROF analyser that can show incoming references.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
There should be a reference to the VThreadReferenced instance.
ACTUAL -
There are no references to the VThreadReferenced instance.
---------- BEGIN SOURCE ----------
-- HprofVThreadStackRef.java ---------------------------------------------------------
import com.sun.management.HotSpotDiagnosticMXBean;
import java.io.File;
import java.lang.management.ManagementFactory;
import java.util.concurrent.CountDownLatch;
public class HprofVThreadStackRef {
public static void main(String[] args) throws Exception {
CountDownLatch dumpedLatch = new CountDownLatch(1);
Thread vthread = Thread.ofVirtual().start(() -> {
Object referenced = new VThreadReferenced();
System.out.println(referenced.getClass());
await(dumpedLatch);
System.out.println(referenced.getClass());
});
Thread.sleep(2000); // wait for reference and unmount
HotSpotDiagnosticMXBean hotSpotDiagnosticMXBean = ManagementFactory.getPlatformMXBean(HotSpotDiagnosticMXBean.class);
File hprofFile = new File("vthread_test.hprof");
hprofFile.delete();
hotSpotDiagnosticMXBean.dumpHeap(hprofFile.getPath(), true);
dumpedLatch.countDown();
vthread.join();
}
private static void await(CountDownLatch dumpedLatch) {
try {
dumpedLatch.await();
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
}
public static class VThreadReferenced {
}
}
--------------------------------------------------------------------------------------
---------- END SOURCE ----------
FREQUENCY : always
- backported by
-
JDK-8321559 Heap dump does not contain virtual Thread stack references
- Closed
- is cloned by
-
JDK-8321565 [REDO] Heap dump does not contain virtual Thread stack references
- Resolved
- relates to
-
JDK-8321560 [BACKOUT] 8299426: Heap dump does not contain virtual Thread stack references
- Closed
-
JDK-8261848 LOOM: SA needs to add support for scanning StackChunks
- Open
-
JDK-8299414 JVMTI FollowReferences should support references from VirtualThread stack
- Resolved
-
JDK-8321560 [BACKOUT] 8299426: Heap dump does not contain virtual Thread stack references
- Closed
(1 relates to, 2 links to)