93 } |
93 } |
94 |
94 |
95 // Causes for collection of the tenured gernation |
95 // Causes for collection of the tenured gernation |
96 inline static bool is_tenured_allocation_failure_gc(GCCause::Cause cause) { |
96 inline static bool is_tenured_allocation_failure_gc(GCCause::Cause cause) { |
97 assert(cause != GCCause::_old_generation_too_full_to_scavenge && |
97 assert(cause != GCCause::_old_generation_too_full_to_scavenge && |
98 cause != GCCause::_old_generation_expanded_on_last_scavenge, |
98 cause != GCCause::_old_generation_expanded_on_last_scavenge, |
99 err_msg("This GCCause may be correct but is not expected yet: %s", |
99 "This GCCause may be correct but is not expected yet: %s", |
100 to_string(cause))); |
100 to_string(cause)); |
101 // _tenured_generation_full or _cms_generation_full for full tenured generations |
101 // _tenured_generation_full or _cms_generation_full for full tenured generations |
102 // _adaptive_size_policy for a full collection after a young GC |
102 // _adaptive_size_policy for a full collection after a young GC |
103 // _allocation_failure is the generic cause a collection which could result |
103 // _allocation_failure is the generic cause a collection which could result |
104 // in the collection of the tenured generation if there is not enough space |
104 // in the collection of the tenured generation if there is not enough space |
105 // in the tenured generation to support a young GC. |
105 // in the tenured generation to support a young GC. |
139 _position = jio_snprintf(_buffer, _length, "%s (%s) ", prefix, GCCause::to_string(cause)); |
139 _position = jio_snprintf(_buffer, _length, "%s (%s) ", prefix, GCCause::to_string(cause)); |
140 } else { |
140 } else { |
141 _position = jio_snprintf(_buffer, _length, "%s ", prefix); |
141 _position = jio_snprintf(_buffer, _length, "%s ", prefix); |
142 } |
142 } |
143 assert(_position >= 0 && _position <= _length, |
143 assert(_position >= 0 && _position <= _length, |
144 err_msg("Need to increase the buffer size in GCCauseString? %d", _position)); |
144 "Need to increase the buffer size in GCCauseString? %d", _position); |
145 } |
145 } |
146 |
146 |
147 GCCauseString& append(const char* str) { |
147 GCCauseString& append(const char* str) { |
148 int res = jio_snprintf(_buffer + _position, _length - _position, "%s", str); |
148 int res = jio_snprintf(_buffer + _position, _length - _position, "%s", str); |
149 _position += res; |
149 _position += res; |
150 assert(res >= 0 && _position <= _length, |
150 assert(res >= 0 && _position <= _length, |
151 err_msg("Need to increase the buffer size in GCCauseString? %d", res)); |
151 "Need to increase the buffer size in GCCauseString? %d", res); |
152 return *this; |
152 return *this; |
153 } |
153 } |
154 |
154 |
155 operator const char*() { |
155 operator const char*() { |
156 return _buffer; |
156 return _buffer; |