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

Print this page
rev 6289 : 8040792: G1CodeRootChunkManager::static_mem_size returns the wrong size
Summary: The G1CodeRootChunkManager::static_mem_size method returned the size of the this pointer instead of the actual static memory size.
Reviewed-by: tbd, tbd


 318   // Support for claiming blocks of cards during iteration
 319   size_t iter_claimed() const { return _iter_claimed; }
 320   // Claim the next block of cards
 321   size_t iter_claimed_next(size_t step) {
 322     return Atomic::add(step, &_iter_claimed) - step;
 323   }
 324 
 325   void reset_for_par_iteration();
 326 
 327   bool verify_ready_for_par_iteration() {
 328     return (_iter_state == Unclaimed) && (_iter_claimed == 0);
 329   }
 330 
 331   // The actual # of bytes this hr_remset takes up.
 332   // Note also includes the strong code root set.
 333   size_t mem_size() {
 334     MutexLockerEx x(&_m, Mutex::_no_safepoint_check_flag);
 335     return _other_regions.mem_size()
 336       // This correction is necessary because the above includes the second
 337       // part.
 338       + (sizeof(this) - sizeof(OtherRegionsTable))
 339       + strong_code_roots_mem_size();
 340   }
 341 
 342   // Returns the memory occupancy of all static data structures associated
 343   // with remembered sets.
 344   static size_t static_mem_size() {
 345     return OtherRegionsTable::static_mem_size() + G1CodeRootSet::static_mem_size();
 346   }
 347 
 348   // Returns the memory occupancy of all free_list data structures associated
 349   // with remembered sets.
 350   static size_t fl_mem_size() {
 351     return OtherRegionsTable::fl_mem_size() + G1CodeRootSet::free_chunks_mem_size();
 352   }
 353 
 354   bool contains_reference(OopOrNarrowOopStar from) const {
 355     return _other_regions.contains_reference(from);
 356   }
 357 
 358   // Routines for managing the list of code roots that point into
 359   // the heap region that owns this RSet.
 360   void add_strong_code_root(nmethod* nm);
 361   void remove_strong_code_root(nmethod* nm);
 362 
 363   // During a collection, migrate the successfully evacuated strong
 364   // code roots that referenced into the region that owns this RSet
 365   // to the RSets of the new regions that they now point into.




 318   // Support for claiming blocks of cards during iteration
 319   size_t iter_claimed() const { return _iter_claimed; }
 320   // Claim the next block of cards
 321   size_t iter_claimed_next(size_t step) {
 322     return Atomic::add(step, &_iter_claimed) - step;
 323   }
 324 
 325   void reset_for_par_iteration();
 326 
 327   bool verify_ready_for_par_iteration() {
 328     return (_iter_state == Unclaimed) && (_iter_claimed == 0);
 329   }
 330 
 331   // The actual # of bytes this hr_remset takes up.
 332   // Note also includes the strong code root set.
 333   size_t mem_size() {
 334     MutexLockerEx x(&_m, Mutex::_no_safepoint_check_flag);
 335     return _other_regions.mem_size()
 336       // This correction is necessary because the above includes the second
 337       // part.
 338       + (sizeof(HeapRegionRemSet) - sizeof(OtherRegionsTable))
 339       + strong_code_roots_mem_size();
 340   }
 341 
 342   // Returns the memory occupancy of all static data structures associated
 343   // with remembered sets.
 344   static size_t static_mem_size() {
 345     return OtherRegionsTable::static_mem_size() + G1CodeRootSet::free_chunks_static_mem_size();
 346   }
 347 
 348   // Returns the memory occupancy of all free_list data structures associated
 349   // with remembered sets.
 350   static size_t fl_mem_size() {
 351     return OtherRegionsTable::fl_mem_size() + G1CodeRootSet::free_chunks_mem_size();
 352   }
 353 
 354   bool contains_reference(OopOrNarrowOopStar from) const {
 355     return _other_regions.contains_reference(from);
 356   }
 357 
 358   // Routines for managing the list of code roots that point into
 359   // the heap region that owns this RSet.
 360   void add_strong_code_root(nmethod* nm);
 361   void remove_strong_code_root(nmethod* nm);
 362 
 363   // During a collection, migrate the successfully evacuated strong
 364   // code roots that referenced into the region that owns this RSet
 365   // to the RSets of the new regions that they now point into.