8329430: MetaspaceShared::preload_and_dump should clear pending exception
Reviewed-by: iklam, stuefe
This commit is contained in:
parent
f7c84137b5
commit
76cbe4883b
@ -665,10 +665,12 @@ void MetaspaceShared::preload_and_dump() {
|
|||||||
if (PENDING_EXCEPTION->is_a(vmClasses::OutOfMemoryError_klass())) {
|
if (PENDING_EXCEPTION->is_a(vmClasses::OutOfMemoryError_klass())) {
|
||||||
log_error(cds)("Out of memory. Please run with a larger Java heap, current MaxHeapSize = "
|
log_error(cds)("Out of memory. Please run with a larger Java heap, current MaxHeapSize = "
|
||||||
SIZE_FORMAT "M", MaxHeapSize/M);
|
SIZE_FORMAT "M", MaxHeapSize/M);
|
||||||
|
CLEAR_PENDING_EXCEPTION;
|
||||||
MetaspaceShared::unrecoverable_writing_error();
|
MetaspaceShared::unrecoverable_writing_error();
|
||||||
} else {
|
} else {
|
||||||
log_error(cds)("%s: %s", PENDING_EXCEPTION->klass()->external_name(),
|
log_error(cds)("%s: %s", PENDING_EXCEPTION->klass()->external_name(),
|
||||||
java_lang_String::as_utf8_string(java_lang_Throwable::message(PENDING_EXCEPTION)));
|
java_lang_String::as_utf8_string(java_lang_Throwable::message(PENDING_EXCEPTION)));
|
||||||
|
CLEAR_PENDING_EXCEPTION;
|
||||||
MetaspaceShared::unrecoverable_writing_error("VM exits due to exception, use -Xlog:cds,exceptions=trace for detail");
|
MetaspaceShared::unrecoverable_writing_error("VM exits due to exception, use -Xlog:cds,exceptions=trace for detail");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user