< prev index next >

src/share/vm/gc_implementation/g1/heapRegionRemSet.hpp

Print this page
rev 7321 : 8048179: Early reclaim of large objects that are referenced by a few objects
Summary: Push the remembered sets of large objects with few referenced into the dirty card queue at the beginning of the evacuation so that they may end up with zero remembered set entries at the end of the collection, and are potentially reclaimed. Also improve timing measurements of the early reclaim mechanism, and shorten flag names.
Reviewed-by: brutisso, jmasa, dfazunen


 164 
 165   // If a PRT for "hr" is in the bucket list indicated by "ind" (which must
 166   // be the correct index for "hr"), delete it and return true; else return
 167   // false.
 168   bool del_single_region_table(size_t ind, HeapRegion* hr);
 169 
 170   // link/add the given fine grain remembered set into the "all" list
 171   void link_to_all(PerRegionTable * prt);
 172   // unlink/remove the given fine grain remembered set into the "all" list
 173   void unlink_from_all(PerRegionTable * prt);
 174 
 175 public:
 176   OtherRegionsTable(HeapRegion* hr, Mutex* m);
 177 
 178   HeapRegion* hr() const { return _hr; }
 179 
 180   // For now.  Could "expand" some tables in the future, so that this made
 181   // sense.
 182   void add_reference(OopOrNarrowOopStar from, int tid);
 183 




 184   // Removes any entries shown by the given bitmaps to contain only dead
 185   // objects.
 186   void scrub(CardTableModRefBS* ctbs, BitMap* region_bm, BitMap* card_bm);
 187 
 188   // Returns whether this remembered set (and all sub-sets) contain no entries.
 189   bool is_empty() const;
 190 
 191   size_t occupied() const;
 192   size_t occ_fine() const;
 193   size_t occ_coarse() const;
 194   size_t occ_sparse() const;
 195 
 196   static jint n_coarsenings() { return _n_coarsenings; }
 197 
 198   // Returns size in bytes.
 199   // Not const because it takes a lock.
 200   size_t mem_size() const;
 201   static size_t static_mem_size();
 202   static size_t fl_mem_size();
 203 


 257 
 258   static const int MaxRecordedEvents = 1000;
 259   static Event*       _recorded_events;
 260   static int*         _recorded_event_index;
 261   static int          _n_recorded_events;
 262 
 263   static void print_event(outputStream* str, Event evnt);
 264 
 265 public:
 266   HeapRegionRemSet(G1BlockOffsetSharedArray* bosa, HeapRegion* hr);
 267 
 268   static uint num_par_rem_sets();
 269   static void setup_remset_size();
 270 
 271   HeapRegion* hr() const {
 272     return _other_regions.hr();
 273   }
 274 
 275   bool is_empty() const {
 276     return (strong_code_roots_list_length() == 0) && _other_regions.is_empty();




 277   }
 278 
 279   size_t occupied() {
 280     MutexLockerEx x(&_m, Mutex::_no_safepoint_check_flag);
 281     return occupied_locked();
 282   }
 283   size_t occupied_locked() {
 284     return _other_regions.occupied();
 285   }
 286   size_t occ_fine() const {
 287     return _other_regions.occ_fine();
 288   }
 289   size_t occ_coarse() const {
 290     return _other_regions.occ_coarse();
 291   }
 292   size_t occ_sparse() const {
 293     return _other_regions.occ_sparse();
 294   }
 295 
 296   static jint n_coarsenings() { return OtherRegionsTable::n_coarsenings(); }




 164 
 165   // If a PRT for "hr" is in the bucket list indicated by "ind" (which must
 166   // be the correct index for "hr"), delete it and return true; else return
 167   // false.
 168   bool del_single_region_table(size_t ind, HeapRegion* hr);
 169 
 170   // link/add the given fine grain remembered set into the "all" list
 171   void link_to_all(PerRegionTable * prt);
 172   // unlink/remove the given fine grain remembered set into the "all" list
 173   void unlink_from_all(PerRegionTable * prt);
 174 
 175 public:
 176   OtherRegionsTable(HeapRegion* hr, Mutex* m);
 177 
 178   HeapRegion* hr() const { return _hr; }
 179 
 180   // For now.  Could "expand" some tables in the future, so that this made
 181   // sense.
 182   void add_reference(OopOrNarrowOopStar from, int tid);
 183 
 184   // Returns whether this remembered set (and all sub-sets) have an occupancy
 185   // that is less or equal than the given occupancy.
 186   bool occupancy_less_or_equal_than(size_t limit) const;
 187 
 188   // Removes any entries shown by the given bitmaps to contain only dead
 189   // objects.
 190   void scrub(CardTableModRefBS* ctbs, BitMap* region_bm, BitMap* card_bm);
 191 
 192   // Returns whether this remembered set (and all sub-sets) contain no entries.
 193   bool is_empty() const;
 194 
 195   size_t occupied() const;
 196   size_t occ_fine() const;
 197   size_t occ_coarse() const;
 198   size_t occ_sparse() const;
 199 
 200   static jint n_coarsenings() { return _n_coarsenings; }
 201 
 202   // Returns size in bytes.
 203   // Not const because it takes a lock.
 204   size_t mem_size() const;
 205   static size_t static_mem_size();
 206   static size_t fl_mem_size();
 207 


 261 
 262   static const int MaxRecordedEvents = 1000;
 263   static Event*       _recorded_events;
 264   static int*         _recorded_event_index;
 265   static int          _n_recorded_events;
 266 
 267   static void print_event(outputStream* str, Event evnt);
 268 
 269 public:
 270   HeapRegionRemSet(G1BlockOffsetSharedArray* bosa, HeapRegion* hr);
 271 
 272   static uint num_par_rem_sets();
 273   static void setup_remset_size();
 274 
 275   HeapRegion* hr() const {
 276     return _other_regions.hr();
 277   }
 278 
 279   bool is_empty() const {
 280     return (strong_code_roots_list_length() == 0) && _other_regions.is_empty();
 281   }
 282 
 283   bool occupancy_less_or_equal_than(size_t occ) const {
 284     return (strong_code_roots_list_length() == 0) && _other_regions.occupancy_less_or_equal_than(occ);
 285   }
 286 
 287   size_t occupied() {
 288     MutexLockerEx x(&_m, Mutex::_no_safepoint_check_flag);
 289     return occupied_locked();
 290   }
 291   size_t occupied_locked() {
 292     return _other_regions.occupied();
 293   }
 294   size_t occ_fine() const {
 295     return _other_regions.occ_fine();
 296   }
 297   size_t occ_coarse() const {
 298     return _other_regions.occ_coarse();
 299   }
 300   size_t occ_sparse() const {
 301     return _other_regions.occ_sparse();
 302   }
 303 
 304   static jint n_coarsenings() { return OtherRegionsTable::n_coarsenings(); }


< prev index next >