8274235: -Xshare:dump should not call vm_direct_exit

Reviewed-by: iklam, dholmes
This commit is contained in:
Calvin Cheung 2022-07-11 15:33:18 +00:00
parent 59980ac8e4
commit c33fa55cf8
3 changed files with 9 additions and 9 deletions

View file

@ -351,9 +351,9 @@ oop HeapShared::archive_object(oop obj) {
log_error(cds, heap)(
"Cannot allocate space for object " PTR_FORMAT " in archived heap region",
p2i(obj));
vm_direct_exit(-1,
err_msg("Out of memory. Please run with a larger Java heap, current MaxHeapSize = "
SIZE_FORMAT "M", MaxHeapSize/M));
log_error(cds)("Out of memory. Please run with a larger Java heap, current MaxHeapSize = "
SIZE_FORMAT "M", MaxHeapSize/M);
os::_exit(-1);
}
return archived_oop;
}
@ -1165,7 +1165,7 @@ oop HeapShared::archive_reachable_objects_from(int level,
// these objects that are referenced (directly or indirectly) by static fields.
ResourceMark rm;
log_error(cds, heap)("Cannot archive object of class %s", orig_obj->klass()->external_name());
vm_direct_exit(1);
os::_exit(1);
}
// java.lang.Class instances cannot be included in an archived object sub-graph. We only support
@ -1175,7 +1175,7 @@ oop HeapShared::archive_reachable_objects_from(int level,
// object that is referenced (directly or indirectly) by static fields.
if (java_lang_Class::is_instance(orig_obj)) {
log_error(cds, heap)("(%d) Unknown java.lang.Class object is in the archived sub-graph", level);
vm_direct_exit(1);
os::_exit(1);
}
oop archived_obj = find_archived_heap_object(orig_obj);
@ -1211,7 +1211,7 @@ oop HeapShared::archive_reachable_objects_from(int level,
// We don't know how to handle an object that has been archived, but some of its reachable
// objects cannot be archived. Bail out for now. We might need to fix this in the future if
// we have a real use case.
vm_direct_exit(1);
os::_exit(1);
}
}