< prev index next >

src/hotspot/share/gc/g1/g1RemSet.cpp

Print this page
rev 49619 : JEP 328 : Flight Recorder open source preview


  25 #include "precompiled.hpp"
  26 #include "gc/g1/dirtyCardQueue.hpp"
  27 #include "gc/g1/g1BlockOffsetTable.inline.hpp"
  28 #include "gc/g1/g1CardTable.inline.hpp"
  29 #include "gc/g1/g1CollectedHeap.inline.hpp"
  30 #include "gc/g1/g1ConcurrentRefine.hpp"
  31 #include "gc/g1/g1FromCardCache.hpp"
  32 #include "gc/g1/g1GCPhaseTimes.hpp"
  33 #include "gc/g1/g1HotCardCache.hpp"
  34 #include "gc/g1/g1OopClosures.inline.hpp"
  35 #include "gc/g1/g1RemSet.hpp"
  36 #include "gc/g1/heapRegion.inline.hpp"
  37 #include "gc/g1/heapRegionManager.inline.hpp"
  38 #include "gc/g1/heapRegionRemSet.hpp"
  39 #include "gc/shared/gcTraceTime.inline.hpp"
  40 #include "gc/shared/suspendibleThreadSet.hpp"
  41 #include "memory/iterator.hpp"
  42 #include "memory/resourceArea.hpp"
  43 #include "oops/access.inline.hpp"
  44 #include "oops/oop.inline.hpp"

  45 #include "utilities/align.hpp"
  46 #include "utilities/globalDefinitions.hpp"
  47 #include "utilities/intHisto.hpp"
  48 #include "utilities/stack.inline.hpp"
  49 #include "utilities/ticks.inline.hpp"
  50 
  51 // Collects information about the overall remembered set scan progress during an evacuation.
  52 class G1RemSetScanState : public CHeapObj<mtGC> {
  53 private:
  54   class G1ClearCardTableTask : public AbstractGangTask {
  55     G1CollectedHeap* _g1h;
  56     uint* _dirty_region_list;
  57     size_t _num_dirty_regions;
  58     size_t _chunk_length;
  59 
  60     size_t volatile _cur_dirty_regions;
  61   public:
  62     G1ClearCardTableTask(G1CollectedHeap* g1h,
  63                          uint* dirty_region_list,
  64                          size_t num_dirty_regions,


 898           break;
 899         }
 900 
 901         const Ticks start = Ticks::now();
 902         size_t marked_bytes = rebuild_rem_set_in_region(_cm->next_mark_bitmap(),
 903                                                         top_at_mark_start,
 904                                                         top_at_rebuild_start,
 905                                                         hr,
 906                                                         next_chunk);
 907         Tickspan time = Ticks::now() - start;
 908 
 909         log_trace(gc, remset, tracking)("Rebuilt region %u "
 910                                         "live " SIZE_FORMAT " "
 911                                         "time %.3fms "
 912                                         "marked bytes " SIZE_FORMAT " "
 913                                         "bot " PTR_FORMAT " "
 914                                         "TAMS " PTR_FORMAT " "
 915                                         "TARS " PTR_FORMAT,
 916                                         region_idx,
 917                                         _cm->liveness(region_idx) * HeapWordSize,
 918                                         TicksToTimeHelper::seconds(time) * 1000.0,
 919                                         marked_bytes,
 920                                         p2i(hr->bottom()),
 921                                         p2i(top_at_mark_start),
 922                                         p2i(top_at_rebuild_start));
 923 
 924         if (marked_bytes > 0) {
 925           hr->add_to_marked_bytes(marked_bytes);
 926           total_marked_bytes += marked_bytes;
 927         }
 928         cur += chunk_size_in_words;
 929 
 930         _cm->do_yield_check();
 931         if (_cm->has_aborted()) {
 932           return true;
 933         }
 934       }
 935       // In the final iteration of the loop the region might have been eagerly reclaimed.
 936       // Simply filter out those regions. We can not just use region type because there
 937       // might have already been new allocations into these regions.
 938       DEBUG_ONLY(HeapWord* const top_at_rebuild_start = _cm->top_at_rebuild_start(region_idx);)




  25 #include "precompiled.hpp"
  26 #include "gc/g1/dirtyCardQueue.hpp"
  27 #include "gc/g1/g1BlockOffsetTable.inline.hpp"
  28 #include "gc/g1/g1CardTable.inline.hpp"
  29 #include "gc/g1/g1CollectedHeap.inline.hpp"
  30 #include "gc/g1/g1ConcurrentRefine.hpp"
  31 #include "gc/g1/g1FromCardCache.hpp"
  32 #include "gc/g1/g1GCPhaseTimes.hpp"
  33 #include "gc/g1/g1HotCardCache.hpp"
  34 #include "gc/g1/g1OopClosures.inline.hpp"
  35 #include "gc/g1/g1RemSet.hpp"
  36 #include "gc/g1/heapRegion.inline.hpp"
  37 #include "gc/g1/heapRegionManager.inline.hpp"
  38 #include "gc/g1/heapRegionRemSet.hpp"
  39 #include "gc/shared/gcTraceTime.inline.hpp"
  40 #include "gc/shared/suspendibleThreadSet.hpp"
  41 #include "memory/iterator.hpp"
  42 #include "memory/resourceArea.hpp"
  43 #include "oops/access.inline.hpp"
  44 #include "oops/oop.inline.hpp"
  45 #include "runtime/os.hpp"
  46 #include "utilities/align.hpp"
  47 #include "utilities/globalDefinitions.hpp"
  48 #include "utilities/intHisto.hpp"
  49 #include "utilities/stack.inline.hpp"
  50 #include "utilities/ticks.inline.hpp"
  51 
  52 // Collects information about the overall remembered set scan progress during an evacuation.
  53 class G1RemSetScanState : public CHeapObj<mtGC> {
  54 private:
  55   class G1ClearCardTableTask : public AbstractGangTask {
  56     G1CollectedHeap* _g1h;
  57     uint* _dirty_region_list;
  58     size_t _num_dirty_regions;
  59     size_t _chunk_length;
  60 
  61     size_t volatile _cur_dirty_regions;
  62   public:
  63     G1ClearCardTableTask(G1CollectedHeap* g1h,
  64                          uint* dirty_region_list,
  65                          size_t num_dirty_regions,


 899           break;
 900         }
 901 
 902         const Ticks start = Ticks::now();
 903         size_t marked_bytes = rebuild_rem_set_in_region(_cm->next_mark_bitmap(),
 904                                                         top_at_mark_start,
 905                                                         top_at_rebuild_start,
 906                                                         hr,
 907                                                         next_chunk);
 908         Tickspan time = Ticks::now() - start;
 909 
 910         log_trace(gc, remset, tracking)("Rebuilt region %u "
 911                                         "live " SIZE_FORMAT " "
 912                                         "time %.3fms "
 913                                         "marked bytes " SIZE_FORMAT " "
 914                                         "bot " PTR_FORMAT " "
 915                                         "TAMS " PTR_FORMAT " "
 916                                         "TARS " PTR_FORMAT,
 917                                         region_idx,
 918                                         _cm->liveness(region_idx) * HeapWordSize,
 919                                         (time.value() / os::elapsed_frequency()) * 1000.0,
 920                                         marked_bytes,
 921                                         p2i(hr->bottom()),
 922                                         p2i(top_at_mark_start),
 923                                         p2i(top_at_rebuild_start));
 924 
 925         if (marked_bytes > 0) {
 926           hr->add_to_marked_bytes(marked_bytes);
 927           total_marked_bytes += marked_bytes;
 928         }
 929         cur += chunk_size_in_words;
 930 
 931         _cm->do_yield_check();
 932         if (_cm->has_aborted()) {
 933           return true;
 934         }
 935       }
 936       // In the final iteration of the loop the region might have been eagerly reclaimed.
 937       // Simply filter out those regions. We can not just use region type because there
 938       // might have already been new allocations into these regions.
 939       DEBUG_ONLY(HeapWord* const top_at_rebuild_start = _cm->top_at_rebuild_start(region_idx);)


< prev index next >