< prev index next >

src/share/vm/gc/g1/collectionSetChooser.hpp

Print this page




  87   // in the CSet chooser.
  88   void remove_and_move_to_next(HeapRegion* hr) {
  89     assert(hr != NULL, "pre-condition");
  90     assert(_curr_index < _length, "pre-condition");
  91     assert(regions_at(_curr_index) == hr, "pre-condition");
  92     regions_at_put(_curr_index, NULL);
  93     assert(hr->reclaimable_bytes() <= _remaining_reclaimable_bytes,
  94            err_msg("remaining reclaimable bytes inconsistent "
  95                    "from region: "SIZE_FORMAT" remaining: "SIZE_FORMAT,
  96                    hr->reclaimable_bytes(), _remaining_reclaimable_bytes));
  97     _remaining_reclaimable_bytes -= hr->reclaimable_bytes();
  98     _curr_index += 1;
  99   }
 100 
 101   CollectionSetChooser();
 102 
 103   void sort_regions();
 104 
 105   // Determine whether to add the given region to the CSet chooser or
 106   // not. Currently, we skip humongous regions (we never add them to
 107   // the CSet, we only reclaim them during cleanup) and regions whose
 108   // live bytes are over the threshold.

 109   bool should_add(HeapRegion* hr) {
 110     assert(hr->is_marked(), "pre-condition");
 111     assert(!hr->is_young(), "should never consider young regions");
 112     return !hr->is_humongous() &&
 113             hr->live_bytes() < _region_live_threshold_bytes;
 114   }
 115 
 116   // Returns the number candidate old regions added
 117   uint length() { return _length; }
 118 
 119   // Serial version.
 120   void add_region(HeapRegion *hr);
 121 
 122   // Must be called before calls to claim_array_chunk().
 123   // n_regions is the number of regions, chunk_size the chunk size.
 124   void prepare_for_par_region_addition(uint n_threads, uint n_regions, uint chunk_size);
 125   // Returns the first index in a contiguous chunk of chunk_size indexes
 126   // that the calling thread has reserved.  These must be set by the
 127   // calling thread using set_region() (to NULL if necessary).
 128   uint claim_array_chunk(uint chunk_size);
 129   // Set the marked array entry at index to hr.  Careful to claim the index
 130   // first if in parallel.
 131   void set_region(uint index, HeapRegion* hr);
 132   // Atomically increment the number of added regions by region_num




  87   // in the CSet chooser.
  88   void remove_and_move_to_next(HeapRegion* hr) {
  89     assert(hr != NULL, "pre-condition");
  90     assert(_curr_index < _length, "pre-condition");
  91     assert(regions_at(_curr_index) == hr, "pre-condition");
  92     regions_at_put(_curr_index, NULL);
  93     assert(hr->reclaimable_bytes() <= _remaining_reclaimable_bytes,
  94            err_msg("remaining reclaimable bytes inconsistent "
  95                    "from region: "SIZE_FORMAT" remaining: "SIZE_FORMAT,
  96                    hr->reclaimable_bytes(), _remaining_reclaimable_bytes));
  97     _remaining_reclaimable_bytes -= hr->reclaimable_bytes();
  98     _curr_index += 1;
  99   }
 100 
 101   CollectionSetChooser();
 102 
 103   void sort_regions();
 104 
 105   // Determine whether to add the given region to the CSet chooser or
 106   // not. Currently, we skip humongous regions (we never add them to
 107   // the CSet, we only reclaim them during cleanup) and archive regions,
 108   // which are both "pinned", and regions whose live bytes are over the 
 109   // threshold.
 110   bool should_add(HeapRegion* hr) {
 111     assert(hr->is_marked(), "pre-condition");
 112     assert(!hr->is_young(), "should never consider young regions");
 113     return !hr->is_pinned() &&
 114             hr->live_bytes() < _region_live_threshold_bytes;
 115   }
 116 
 117   // Returns the number candidate old regions added
 118   uint length() { return _length; }
 119 
 120   // Serial version.
 121   void add_region(HeapRegion *hr);
 122 
 123   // Must be called before calls to claim_array_chunk().
 124   // n_regions is the number of regions, chunk_size the chunk size.
 125   void prepare_for_par_region_addition(uint n_threads, uint n_regions, uint chunk_size);
 126   // Returns the first index in a contiguous chunk of chunk_size indexes
 127   // that the calling thread has reserved.  These must be set by the
 128   // calling thread using set_region() (to NULL if necessary).
 129   uint claim_array_chunk(uint chunk_size);
 130   // Set the marked array entry at index to hr.  Careful to claim the index
 131   // first if in parallel.
 132   void set_region(uint index, HeapRegion* hr);
 133   // Atomically increment the number of added regions by region_num


< prev index next >