comparison src/share/vm/memory/metaspace.cpp @ 17770:5af31f70a866

8036701: Add trace event when a metaspace throws out of memory error Reviewed-by: stefank, mgerdin
author ehelin
date Fri, 21 Mar 2014 10:28:07 +0100
parents bc7714614ad8
children 9fdaa79b0c27
comparison
equal deleted inserted replaced
17769:bc7714614ad8 17770:5af31f70a866
3368 loader_data, word_size, mdtype); 3368 loader_data, word_size, mdtype);
3369 } 3369 }
3370 } 3370 }
3371 3371
3372 if (result == NULL) { 3372 if (result == NULL) {
3373 report_metadata_oome(loader_data, word_size, mdtype, CHECK_NULL); 3373 report_metadata_oome(loader_data, word_size, type, mdtype, CHECK_NULL);
3374 } 3374 }
3375 3375
3376 // Zero initialize. 3376 // Zero initialize.
3377 Copy::fill_to_aligned_words((HeapWord*)result, word_size, 0); 3377 Copy::fill_to_aligned_words((HeapWord*)result, word_size, 0);
3378 3378
3382 size_t Metaspace::class_chunk_size(size_t word_size) { 3382 size_t Metaspace::class_chunk_size(size_t word_size) {
3383 assert(using_class_space(), "Has to use class space"); 3383 assert(using_class_space(), "Has to use class space");
3384 return class_vsm()->calc_chunk_size(word_size); 3384 return class_vsm()->calc_chunk_size(word_size);
3385 } 3385 }
3386 3386
3387 void Metaspace::report_metadata_oome(ClassLoaderData* loader_data, size_t word_size, MetadataType mdtype, TRAPS) { 3387 void Metaspace::report_metadata_oome(ClassLoaderData* loader_data, size_t word_size, MetaspaceObj::Type type, MetadataType mdtype, TRAPS) {
3388 tracer()->report_metadata_oom(loader_data, word_size, type, mdtype);
3389
3388 // If result is still null, we are out of memory. 3390 // If result is still null, we are out of memory.
3389 if (Verbose && TraceMetadataChunkAllocation) { 3391 if (Verbose && TraceMetadataChunkAllocation) {
3390 gclog_or_tty->print_cr("Metaspace allocation failed for size " 3392 gclog_or_tty->print_cr("Metaspace allocation failed for size "
3391 SIZE_FORMAT, word_size); 3393 SIZE_FORMAT, word_size);
3392 if (loader_data->metaspace_or_null() != NULL) { 3394 if (loader_data->metaspace_or_null() != NULL) {