3369 loader_data, word_size, mdtype); |
3369 loader_data, word_size, mdtype); |
3370 } |
3370 } |
3371 } |
3371 } |
3372 |
3372 |
3373 if (result == NULL) { |
3373 if (result == NULL) { |
3374 report_metadata_oome(loader_data, word_size, mdtype, CHECK_NULL); |
3374 report_metadata_oome(loader_data, word_size, type, mdtype, CHECK_NULL); |
3375 } |
3375 } |
3376 |
3376 |
3377 // Zero initialize. |
3377 // Zero initialize. |
3378 Copy::fill_to_aligned_words((HeapWord*)result, word_size, 0); |
3378 Copy::fill_to_aligned_words((HeapWord*)result, word_size, 0); |
3379 |
3379 |
3383 size_t Metaspace::class_chunk_size(size_t word_size) { |
3383 size_t Metaspace::class_chunk_size(size_t word_size) { |
3384 assert(using_class_space(), "Has to use class space"); |
3384 assert(using_class_space(), "Has to use class space"); |
3385 return class_vsm()->calc_chunk_size(word_size); |
3385 return class_vsm()->calc_chunk_size(word_size); |
3386 } |
3386 } |
3387 |
3387 |
3388 void Metaspace::report_metadata_oome(ClassLoaderData* loader_data, size_t word_size, MetadataType mdtype, TRAPS) { |
3388 void Metaspace::report_metadata_oome(ClassLoaderData* loader_data, size_t word_size, MetaspaceObj::Type type, MetadataType mdtype, TRAPS) { |
|
3389 tracer()->report_metadata_oom(loader_data, word_size, type, mdtype); |
|
3390 |
3389 // If result is still null, we are out of memory. |
3391 // If result is still null, we are out of memory. |
3390 if (Verbose && TraceMetadataChunkAllocation) { |
3392 if (Verbose && TraceMetadataChunkAllocation) { |
3391 gclog_or_tty->print_cr("Metaspace allocation failed for size " |
3393 gclog_or_tty->print_cr("Metaspace allocation failed for size " |
3392 SIZE_FORMAT, word_size); |
3394 SIZE_FORMAT, word_size); |
3393 if (loader_data->metaspace_or_null() != NULL) { |
3395 if (loader_data->metaspace_or_null() != NULL) { |