equal
deleted
inserted
replaced
42 #include "jfr/periodic/jfrThreadCPULoadEvent.hpp" |
42 #include "jfr/periodic/jfrThreadCPULoadEvent.hpp" |
43 #include "jfr/periodic/jfrThreadDumpEvent.hpp" |
43 #include "jfr/periodic/jfrThreadDumpEvent.hpp" |
44 #include "jfr/periodic/jfrNetworkUtilization.hpp" |
44 #include "jfr/periodic/jfrNetworkUtilization.hpp" |
45 #include "jfr/recorder/jfrRecorder.hpp" |
45 #include "jfr/recorder/jfrRecorder.hpp" |
46 #include "jfr/support/jfrThreadId.hpp" |
46 #include "jfr/support/jfrThreadId.hpp" |
|
47 #include "jfr/utilities/jfrThreadIterator.hpp" |
47 #include "jfr/utilities/jfrTime.hpp" |
48 #include "jfr/utilities/jfrTime.hpp" |
48 #include "jfrfiles/jfrPeriodic.hpp" |
49 #include "jfrfiles/jfrPeriodic.hpp" |
49 #include "logging/log.hpp" |
50 #include "logging/log.hpp" |
50 #include "memory/heapInspection.hpp" |
51 #include "memory/heapInspection.hpp" |
51 #include "memory/resourceArea.hpp" |
52 #include "memory/resourceArea.hpp" |
54 #include "runtime/flags/jvmFlag.hpp" |
55 #include "runtime/flags/jvmFlag.hpp" |
55 #include "runtime/globals.hpp" |
56 #include "runtime/globals.hpp" |
56 #include "runtime/os.hpp" |
57 #include "runtime/os.hpp" |
57 #include "runtime/os_perf.hpp" |
58 #include "runtime/os_perf.hpp" |
58 #include "runtime/thread.inline.hpp" |
59 #include "runtime/thread.inline.hpp" |
59 #include "runtime/threadSMR.hpp" |
|
60 #include "runtime/sweeper.hpp" |
60 #include "runtime/sweeper.hpp" |
61 #include "runtime/vmThread.hpp" |
61 #include "runtime/vmThread.hpp" |
62 #include "services/classLoadingService.hpp" |
62 #include "services/classLoadingService.hpp" |
63 #include "services/management.hpp" |
63 #include "services/management.hpp" |
64 #include "services/threadService.hpp" |
64 #include "services/threadService.hpp" |
408 ResourceMark rm; |
408 ResourceMark rm; |
409 int initial_size = Threads::number_of_threads(); |
409 int initial_size = Threads::number_of_threads(); |
410 GrowableArray<jlong> allocated(initial_size); |
410 GrowableArray<jlong> allocated(initial_size); |
411 GrowableArray<traceid> thread_ids(initial_size); |
411 GrowableArray<traceid> thread_ids(initial_size); |
412 JfrTicks time_stamp = JfrTicks::now(); |
412 JfrTicks time_stamp = JfrTicks::now(); |
413 { |
413 JfrJavaThreadIterator iter; |
414 // Collect allocation statistics while holding threads lock |
414 while (iter.has_next()) { |
415 MutexLocker ml(Threads_lock); |
415 JavaThread* const jt = iter.next(); |
416 for (JavaThreadIteratorWithHandle jtiwh; JavaThread *jt = jtiwh.next(); ) { |
416 assert(jt != NULL, "invariant"); |
417 allocated.append(jt->cooked_allocated_bytes()); |
417 allocated.append(jt->cooked_allocated_bytes()); |
418 thread_ids.append(JFR_THREAD_ID(jt)); |
418 thread_ids.append(JFR_THREAD_ID(jt)); |
419 } |
|
420 } |
419 } |
421 |
420 |
422 // Write allocation statistics to buffer. |
421 // Write allocation statistics to buffer. |
423 for(int i = 0; i < thread_ids.length(); i++) { |
422 for(int i = 0; i < thread_ids.length(); i++) { |
424 EventThreadAllocationStatistics event(UNTIMED); |
423 EventThreadAllocationStatistics event(UNTIMED); |