1100 // In support of MinChunkSize being larger than min object size 1101 const double _dilatation_factor; 1102 1103 enum CollectionTypes { 1104 Concurrent_collection_type = 0, 1105 MS_foreground_collection_type = 1, 1106 MSC_foreground_collection_type = 2, 1107 Unknown_collection_type = 3 1108 }; 1109 1110 CollectionTypes _debug_collection_type; 1111 1112 // True if a compacting collection was done. 1113 bool _did_compact; 1114 bool did_compact() { return _did_compact; } 1115 1116 // Fraction of current occupancy at which to start a CMS collection which 1117 // will collect this generation (at least). 1118 double _initiating_occupancy; 1119 1120 protected: 1121 // Shrink generation by specified size (returns false if unable to shrink) 1122 void shrink_free_list_by(size_t bytes); 1123 1124 // Update statistics for GC 1125 virtual void update_gc_stats(int level, bool full); 1126 1127 // Maximum available space in the generation (including uncommitted) 1128 // space. 1129 size_t max_available() const; 1130 1131 // getter and initializer for _initiating_occupancy field. 1132 double initiating_occupancy() const { return _initiating_occupancy; } 1133 void init_initiating_occupancy(intx io, uintx tr); 1134 1135 public: 1136 ConcurrentMarkSweepGeneration(ReservedSpace rs, size_t initial_byte_size, 1137 int level, CardTableRS* ct, 1138 bool use_adaptive_freelists, 1139 FreeBlockDictionary<FreeChunk>::DictionaryChoice); 1140 1141 // Accessors 1142 CMSCollector* collector() const { return _collector; } 1143 static void set_collector(CMSCollector* collector) { 1144 assert(_collector == NULL, "already set"); 1145 _collector = collector; 1146 } 1147 CompactibleFreeListSpace* cmsSpace() const { return _cmsSpace; } 1148 1149 Mutex* freelistLock() const; 1150 1151 virtual Generation::Name kind() { return Generation::ConcurrentMarkSweep; } 1152 1153 void set_did_compact(bool v) { _did_compact = v; } | 1100 // In support of MinChunkSize being larger than min object size 1101 const double _dilatation_factor; 1102 1103 enum CollectionTypes { 1104 Concurrent_collection_type = 0, 1105 MS_foreground_collection_type = 1, 1106 MSC_foreground_collection_type = 2, 1107 Unknown_collection_type = 3 1108 }; 1109 1110 CollectionTypes _debug_collection_type; 1111 1112 // True if a compacting collection was done. 1113 bool _did_compact; 1114 bool did_compact() { return _did_compact; } 1115 1116 // Fraction of current occupancy at which to start a CMS collection which 1117 // will collect this generation (at least). 1118 double _initiating_occupancy; 1119 1120 // Set to 1, if another GC thread already had a promotion failure. 1121 // This is boolean, but used juint type to call OrderAccess. 1122 juint _has_promotion_failed; 1123 1124 protected: 1125 // Shrink generation by specified size (returns false if unable to shrink) 1126 void shrink_free_list_by(size_t bytes); 1127 1128 // Update statistics for GC 1129 virtual void update_gc_stats(int level, bool full); 1130 1131 // Maximum available space in the generation (including uncommitted) 1132 // space. 1133 size_t max_available() const; 1134 1135 // getter and initializer for _initiating_occupancy field. 1136 double initiating_occupancy() const { return _initiating_occupancy; } 1137 void init_initiating_occupancy(intx io, uintx tr); 1138 1139 // Support for CMSFastPromotionFailure 1140 bool has_promotion_failed() { return OrderAccess::load_acquire(&_has_promotion_failed) != 0; } 1141 bool set_promotion_failed() { OrderAccess::release_store(&_has_promotion_failed, 1); } 1142 bool reset_promotion_failed() { OrderAccess::release_store(&_has_promotion_failed, 0); } 1143 1144 public: 1145 ConcurrentMarkSweepGeneration(ReservedSpace rs, size_t initial_byte_size, 1146 int level, CardTableRS* ct, 1147 bool use_adaptive_freelists, 1148 FreeBlockDictionary<FreeChunk>::DictionaryChoice); 1149 1150 // Accessors 1151 CMSCollector* collector() const { return _collector; } 1152 static void set_collector(CMSCollector* collector) { 1153 assert(_collector == NULL, "already set"); 1154 _collector = collector; 1155 } 1156 CompactibleFreeListSpace* cmsSpace() const { return _cmsSpace; } 1157 1158 Mutex* freelistLock() const; 1159 1160 virtual Generation::Name kind() { return Generation::ConcurrentMarkSweep; } 1161 1162 void set_did_compact(bool v) { _did_compact = v; } |