Mercurial > hg > graal-compiler
comparison src/share/vm/gc_implementation/g1/concurrentG1Refine.cpp @ 6219:922993931b3d
7178361: G1: Make sure that PrintGC and PrintGCDetails use the same timing for the GC pause
Summary: Also reviewed by: vitalyd@gmail.com. Move the timing out of G1CollectorPolicy into the G1GCPhaseTimes class
Reviewed-by: johnc
author | brutisso |
---|---|
date | Wed, 11 Jul 2012 22:47:38 +0200 |
parents | c84ee870e0b9 |
children | 3a431b605145 |
comparison
equal
deleted
inserted
replaced
6196:3759236eea14 | 6219:922993931b3d |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved. | 2 * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * | 4 * |
5 * This code is free software; you can redistribute it and/or modify it | 5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as | 6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
25 #include "precompiled.hpp" | 25 #include "precompiled.hpp" |
26 #include "gc_implementation/g1/concurrentG1Refine.hpp" | 26 #include "gc_implementation/g1/concurrentG1Refine.hpp" |
27 #include "gc_implementation/g1/concurrentG1RefineThread.hpp" | 27 #include "gc_implementation/g1/concurrentG1RefineThread.hpp" |
28 #include "gc_implementation/g1/g1CollectedHeap.inline.hpp" | 28 #include "gc_implementation/g1/g1CollectedHeap.inline.hpp" |
29 #include "gc_implementation/g1/g1CollectorPolicy.hpp" | 29 #include "gc_implementation/g1/g1CollectorPolicy.hpp" |
30 #include "gc_implementation/g1/g1GCPhaseTimes.hpp" | |
30 #include "gc_implementation/g1/g1RemSet.hpp" | 31 #include "gc_implementation/g1/g1RemSet.hpp" |
31 #include "gc_implementation/g1/heapRegionSeq.inline.hpp" | 32 #include "gc_implementation/g1/heapRegionSeq.inline.hpp" |
32 #include "memory/space.inline.hpp" | 33 #include "memory/space.inline.hpp" |
33 #include "runtime/atomic.hpp" | 34 #include "runtime/atomic.hpp" |
34 #include "runtime/java.hpp" | 35 #include "runtime/java.hpp" |
498 // We did not successfully expand the caches. | 499 // We did not successfully expand the caches. |
499 return false; | 500 return false; |
500 } | 501 } |
501 | 502 |
502 void ConcurrentG1Refine::clear_and_record_card_counts() { | 503 void ConcurrentG1Refine::clear_and_record_card_counts() { |
503 if (G1ConcRSLogCacheSize == 0) return; | 504 if (G1ConcRSLogCacheSize == 0) { |
504 | 505 return; |
505 #ifndef PRODUCT | 506 } |
507 | |
506 double start = os::elapsedTime(); | 508 double start = os::elapsedTime(); |
507 #endif | |
508 | 509 |
509 if (_expand_card_counts) { | 510 if (_expand_card_counts) { |
510 int new_idx = _cache_size_index + 1; | 511 int new_idx = _cache_size_index + 1; |
511 | 512 |
512 if (expand_card_count_cache(new_idx)) { | 513 if (expand_card_count_cache(new_idx)) { |
521 | 522 |
522 int this_epoch = (int) _n_periods; | 523 int this_epoch = (int) _n_periods; |
523 assert((this_epoch+1) <= max_jint, "to many periods"); | 524 assert((this_epoch+1) <= max_jint, "to many periods"); |
524 // Update epoch | 525 // Update epoch |
525 _n_periods++; | 526 _n_periods++; |
526 | 527 double cc_clear_time_ms = (os::elapsedTime() - start) * 1000; |
527 #ifndef PRODUCT | 528 _g1h->g1_policy()->phase_times()->record_cc_clear_time_ms(cc_clear_time_ms); |
528 double elapsed = os::elapsedTime() - start; | |
529 _g1h->g1_policy()->record_cc_clear_time(elapsed * 1000.0); | |
530 #endif | |
531 } | 529 } |
532 | 530 |
533 void ConcurrentG1Refine::print_worker_threads_on(outputStream* st) const { | 531 void ConcurrentG1Refine::print_worker_threads_on(outputStream* st) const { |
534 for (int i = 0; i < _n_threads; ++i) { | 532 for (int i = 0; i < _n_threads; ++i) { |
535 _threads[i]->print_on(st); | 533 _threads[i]->print_on(st); |