src/share/vm/memory/metaspace.cpp

Print this page
rev 6085 : 8036701: Add trace event when a metaspace throws out of memory error

*** 3369,3379 **** loader_data, word_size, mdtype); } } if (result == NULL) { ! report_metadata_oome(loader_data, word_size, mdtype, CHECK_NULL); } // Zero initialize. Copy::fill_to_aligned_words((HeapWord*)result, word_size, 0); --- 3369,3379 ---- loader_data, word_size, mdtype); } } if (result == NULL) { ! report_metadata_oome(loader_data, word_size, type, mdtype, CHECK_NULL); } // Zero initialize. Copy::fill_to_aligned_words((HeapWord*)result, word_size, 0);
*** 3383,3393 **** size_t Metaspace::class_chunk_size(size_t word_size) { assert(using_class_space(), "Has to use class space"); return class_vsm()->calc_chunk_size(word_size); } ! void Metaspace::report_metadata_oome(ClassLoaderData* loader_data, size_t word_size, MetadataType mdtype, TRAPS) { // If result is still null, we are out of memory. if (Verbose && TraceMetadataChunkAllocation) { gclog_or_tty->print_cr("Metaspace allocation failed for size " SIZE_FORMAT, word_size); if (loader_data->metaspace_or_null() != NULL) { --- 3383,3395 ---- size_t Metaspace::class_chunk_size(size_t word_size) { assert(using_class_space(), "Has to use class space"); return class_vsm()->calc_chunk_size(word_size); } ! void Metaspace::report_metadata_oome(ClassLoaderData* loader_data, size_t word_size, MetaspaceObj::Type type, MetadataType mdtype, TRAPS) { ! tracer()->report_metadata_oom(loader_data, word_size, type, mdtype); ! // If result is still null, we are out of memory. if (Verbose && TraceMetadataChunkAllocation) { gclog_or_tty->print_cr("Metaspace allocation failed for size " SIZE_FORMAT, word_size); if (loader_data->metaspace_or_null() != NULL) {