--- old/src/hotspot/share/memory/metaspace.cpp 2018-10-23 21:29:46.974071611 -0700 +++ new/src/hotspot/share/memory/metaspace.cpp 2018-10-23 21:29:46.613037423 -0700 @@ -1291,9 +1291,9 @@ if (DumpSharedSpaces) { // CDS dumping keeps loading classes, so if we hit an OOM we probably will keep hitting OOM. // We should abort to avoid generating a potentially bad archive. - tty->print_cr("Failed allocating metaspace object type %s of size " SIZE_FORMAT ". CDS dump aborted.", + log_error(cds)("Failed allocating metaspace object type %s of size " SIZE_FORMAT ". CDS dump aborted.", MetaspaceObj::type_name(type), word_size * BytesPerWord); - tty->print_cr("Please increase MaxMetaspaceSize (currently " SIZE_FORMAT " bytes).", MaxMetaspaceSize); + log_error(cds)("Please increase MaxMetaspaceSize (currently " SIZE_FORMAT " bytes).", MaxMetaspaceSize); vm_exit(1); } report_metadata_oome(loader_data, word_size, type, mdtype, THREAD);