--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ObjectHeap.java Tue May 21 00:52:04 2019 -0700
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ObjectHeap.java Tue May 21 10:34:57 2019 +0200
@@ -357,7 +357,9 @@
// end.
if (VM.getVM().getUseTLAB()) {
- for (JavaThread thread = VM.getVM().getThreads().first(); thread != null; thread = thread.next()) {
+ Threads threads = VM.getVM().getThreads();
+ for (int i = 0; i < threads.getNumberOfThreads(); i++) {
+ JavaThread thread = threads.getJavaThreadAt(i);
ThreadLocalAllocBuffer tlab = thread.tlab();
if (tlab.start() != null) {
if ((tlab.top() == null) || (tlab.end() == null)) {