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

@ -329,7 +329,7 @@ address ArchiveBuilder::reserve_buffer() {
ReservedSpace rs(buffer_size, MetaspaceShared::core_region_alignment(), os::vm_page_size());
if (!rs.is_reserved()) {
log_error(cds)("Failed to reserve " SIZE_FORMAT " bytes of output buffer.", buffer_size);
vm_direct_exit(0);
os::_exit(0);
}
// buffer_bottom is the lowest address of the 2 core regions (rw, ro) when
@ -379,7 +379,7 @@ address ArchiveBuilder::reserve_buffer() {
log_error(cds)("my_archive_requested_top = " INTPTR_FORMAT, p2i(my_archive_requested_top));
log_error(cds)("SharedBaseAddress (" INTPTR_FORMAT ") is too high. "
"Please rerun java -Xshare:dump with a lower value", p2i(_requested_static_archive_bottom));
vm_direct_exit(0);
os::_exit(0);
}
if (DumpSharedSpaces) {

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);
}
}

View File

@ -582,7 +582,7 @@ void VM_PopulateDumpSharedSpace::doit() {
// There may be pending VM operations. We have changed some global states
// (such as vmClasses::_klasses) that may cause these VM operations
// to fail. For safety, forget these operations and exit the VM directly.
vm_direct_exit(0);
os::_exit(0);
}
class CollectCLDClosure : public CLDClosure {