equal
deleted
inserted
replaced
269 _result = _loader_data->metaspace_non_null()->expand_and_allocate(_size, _mdtype); |
269 _result = _loader_data->metaspace_non_null()->expand_and_allocate(_size, _mdtype); |
270 if (_result != NULL) { |
270 if (_result != NULL) { |
271 return; |
271 return; |
272 } |
272 } |
273 |
273 |
274 // If expansion failed, do a last-ditch collection and try allocating |
274 // If expansion failed, do a collection clearing soft references. |
275 // again. A last-ditch collection will clear softrefs. This |
275 heap->collect_as_vm_thread(GCCause::_metadata_GC_clear_soft_refs); |
276 // behavior is similar to the last-ditch collection done for perm |
|
277 // gen when it was full and a collection for failed allocation |
|
278 // did not free perm gen space. |
|
279 heap->collect_as_vm_thread(GCCause::_last_ditch_collection); |
|
280 _result = _loader_data->metaspace_non_null()->allocate(_size, _mdtype); |
276 _result = _loader_data->metaspace_non_null()->allocate(_size, _mdtype); |
281 if (_result != NULL) { |
277 if (_result != NULL) { |
282 return; |
278 return; |
283 } |
279 } |
284 |
280 |