src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hotspot Sdiff src/share/vm/gc_implementation/concurrentMarkSweep

src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp

Print this page
rev 6345 : 8027643: Merge GenCollectorPolicy and TwoGenerationCollectorPolicy
Summary: Merged the two calsses GenCollectorPolicy and TwoGenerationCollectorPolicy
Reviewed-by:
rev 6347 : 8042298: Remove the names gen0 and gen1 from the GC code
Summary: Renamed gen0 and gen1 to young and old throughout the GC code.
Reviewed-by:


1119         }
1120       } else {  // not an obj array; we can just mark the head
1121         if (par) {
1122           _modUnionTable.par_mark(start);
1123         } else {
1124           _modUnionTable.mark(start);
1125         }
1126       }
1127     }
1128   }
1129 }
1130 
1131 static inline size_t percent_of_space(Space* space, HeapWord* addr)
1132 {
1133   size_t delta = pointer_delta(addr, space->bottom());
1134   return (size_t)(delta * 100.0 / (space->capacity() / HeapWordSize));
1135 }
1136 
1137 void CMSCollector::icms_update_allocation_limits()
1138 {
1139   Generation* gen0 = GenCollectedHeap::heap()->get_gen(0);
1140   EdenSpace* eden = gen0->as_DefNewGeneration()->eden();
1141 
1142   const unsigned int duty_cycle = stats().icms_update_duty_cycle();
1143   if (CMSTraceIncrementalPacing) {
1144     stats().print();
1145   }
1146 
1147   assert(duty_cycle <= 100, "invalid duty cycle");
1148   if (duty_cycle != 0) {
1149     // The duty_cycle is a percentage between 0 and 100; convert to words and
1150     // then compute the offset from the endpoints of the space.
1151     size_t free_words = eden->free() / HeapWordSize;
1152     double free_words_dbl = (double)free_words;
1153     size_t duty_cycle_words = (size_t)(free_words_dbl * duty_cycle / 100.0);
1154     size_t offset_words = (free_words - duty_cycle_words) / 2;
1155 
1156     _icms_start_limit = eden->top() + offset_words;
1157     _icms_stop_limit = eden->end() - offset_words;
1158 
1159     // The limits may be adjusted (shifted to the right) by
1160     // CMSIncrementalOffset, to allow the application more mutator time after a




1119         }
1120       } else {  // not an obj array; we can just mark the head
1121         if (par) {
1122           _modUnionTable.par_mark(start);
1123         } else {
1124           _modUnionTable.mark(start);
1125         }
1126       }
1127     }
1128   }
1129 }
1130 
1131 static inline size_t percent_of_space(Space* space, HeapWord* addr)
1132 {
1133   size_t delta = pointer_delta(addr, space->bottom());
1134   return (size_t)(delta * 100.0 / (space->capacity() / HeapWordSize));
1135 }
1136 
1137 void CMSCollector::icms_update_allocation_limits()
1138 {
1139   Generation* young = GenCollectedHeap::heap()->get_gen(0);
1140   EdenSpace* eden = young->as_DefNewGeneration()->eden();
1141 
1142   const unsigned int duty_cycle = stats().icms_update_duty_cycle();
1143   if (CMSTraceIncrementalPacing) {
1144     stats().print();
1145   }
1146 
1147   assert(duty_cycle <= 100, "invalid duty cycle");
1148   if (duty_cycle != 0) {
1149     // The duty_cycle is a percentage between 0 and 100; convert to words and
1150     // then compute the offset from the endpoints of the space.
1151     size_t free_words = eden->free() / HeapWordSize;
1152     double free_words_dbl = (double)free_words;
1153     size_t duty_cycle_words = (size_t)(free_words_dbl * duty_cycle / 100.0);
1154     size_t offset_words = (free_words - duty_cycle_words) / 2;
1155 
1156     _icms_start_limit = eden->top() + offset_words;
1157     _icms_stop_limit = eden->end() - offset_words;
1158 
1159     // The limits may be adjusted (shifted to the right) by
1160     // CMSIncrementalOffset, to allow the application more mutator time after a


src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File