diff --git a/runtime/vm/JFRChunkWriter.hpp b/runtime/vm/JFRChunkWriter.hpp index 171c124fc02..9d82c75298c 100644 --- a/runtime/vm/JFRChunkWriter.hpp +++ b/runtime/vm/JFRChunkWriter.hpp @@ -158,6 +158,7 @@ class VM_JFRChunkWriter { static constexpr int THREAD_END_EVENT_SIZE = (4 * sizeof(U_64)) + sizeof(U_32); static constexpr int THREAD_SLEEP_EVENT_SIZE = (7 * sizeof(U_64)) + sizeof(U_32); static constexpr int MONITOR_WAIT_EVENT_SIZE = (9 * sizeof(U_64)) + sizeof(U_32); + static constexpr int THREAD_PARK_EVENT_SIZE = (9 * sizeof(U_64)) + sizeof(U_32); static constexpr int JVM_INFORMATION_EVENT_SIZE = 3000; static constexpr int PHYSICAL_MEMORY_EVENT_SIZE = (4 * sizeof(U_64)) + sizeof(U_32); static constexpr int VIRTUALIZATION_INFORMATION_EVENT_SIZE = 50; @@ -768,6 +769,8 @@ class VM_JFRChunkWriter { requiredBufferSize += (_constantPoolTypes.getMonitorWaitCount() * MONITOR_WAIT_EVENT_SIZE); + requiredBufferSize += (_constantPoolTypes.getThreadParkCount() * THREAD_PARK_EVENT_SIZE); + requiredBufferSize += JVM_INFORMATION_EVENT_SIZE; requiredBufferSize += OS_INFORMATION_EVENT_SIZE; diff --git a/runtime/vm/JFRConstantPoolTypes.cpp b/runtime/vm/JFRConstantPoolTypes.cpp index bbca435fbab..cb128ebfae8 100644 --- a/runtime/vm/JFRConstantPoolTypes.cpp +++ b/runtime/vm/JFRConstantPoolTypes.cpp @@ -1126,6 +1126,8 @@ VM_JFRConstantPoolTypes::addThreadParkEntry(J9JFRThreadParked* threadParkData) entry->timeOut = threadParkData->timeOut; entry->untilTime = threadParkData->untilTime; + _threadParkCount += 1; + done: return; }