|
28 | 28 | #include "gc/shenandoah/shenandoahHeap.inline.hpp"
|
29 | 29 | #include "gc/shenandoah/shenandoahOldGeneration.hpp"
|
30 | 30 | #include "gc/shenandoah/shenandoahYoungGeneration.hpp"
|
| 31 | +#include "logging/log.hpp" |
31 | 32 | #include "runtime/os.hpp"
|
32 | 33 | #include "runtime/task.hpp"
|
33 |
| -#include "logging/log.hpp" |
34 | 34 |
|
35 | 35 |
|
36 | 36 | class ShenandoahMmuTask : public PeriodicTask {
|
@@ -94,12 +94,17 @@ void ShenandoahMmuTracker::report() {
|
94 | 94 | // This is only called by the periodic thread.
|
95 | 95 | double process_time_s = process_time_seconds();
|
96 | 96 | double elapsed_process_time_s = process_time_s - _process_reference_time_s;
|
| 97 | + if (elapsed_process_time_s <= 0.01) { |
| 98 | + // No cpu time for this interval? |
| 99 | + return; |
| 100 | + } |
| 101 | + |
97 | 102 | _process_reference_time_s = process_time_s;
|
98 |
| - double verify_time_s = gc_thread_time_seconds(); |
99 |
| - double verify_elapsed = verify_time_s - _collector_reference_time_s; |
100 |
| - _collector_reference_time_s = verify_time_s; |
101 |
| - double verify_mmu = ((elapsed_process_time_s - verify_elapsed) / elapsed_process_time_s) * 100; |
102 |
| - _mmu_average.add(verify_mmu); |
| 103 | + double collector_time_s = gc_thread_time_seconds(); |
| 104 | + double elapsed_collector_time_s = collector_time_s - _collector_reference_time_s; |
| 105 | + _collector_reference_time_s = collector_time_s; |
| 106 | + double minimum_mutator_utilization = ((elapsed_process_time_s - elapsed_collector_time_s) / elapsed_process_time_s) * 100; |
| 107 | + _mmu_average.add(minimum_mutator_utilization); |
103 | 108 | log_info(gc)("Average MMU = %.3f", _mmu_average.davg());
|
104 | 109 | }
|
105 | 110 |
|
|
0 commit comments