< prev index next >

src/hotspot/share/memory/metaspace.cpp

Print this page




3977   return result;
3978 }
3979 
3980 size_t Metaspace::class_chunk_size(size_t word_size) {
3981   assert(using_class_space(), "Has to use class space");
3982   return class_vsm()->calc_chunk_size(word_size);
3983 }
3984 
3985 void Metaspace::report_metadata_oome(ClassLoaderData* loader_data, size_t word_size, MetaspaceObj::Type type, MetadataType mdtype, TRAPS) {
3986   tracer()->report_metadata_oom(loader_data, word_size, type, mdtype);
3987 
3988   // If result is still null, we are out of memory.
3989   Log(gc, metaspace, freelist) log;
3990   if (log.is_info()) {
3991     log.info("Metaspace (%s) allocation failed for size " SIZE_FORMAT,
3992              is_class_space_allocation(mdtype) ? "class" : "data", word_size);
3993     ResourceMark rm;
3994     if (log.is_debug()) {
3995       if (loader_data->metaspace_or_null() != NULL) {
3996         LogStream ls(log.debug());
3997         loader_data->dump(&ls);
3998       }
3999     }
4000     LogStream ls(log.info());
4001     MetaspaceAux::dump(&ls);
4002     MetaspaceAux::print_metaspace_map(&ls, mdtype);
4003     ChunkManager::print_all_chunkmanagers(&ls);
4004   }
4005 
4006   bool out_of_compressed_class_space = false;
4007   if (is_class_space_allocation(mdtype)) {
4008     Metaspace* metaspace = loader_data->metaspace_non_null();
4009     out_of_compressed_class_space =
4010       MetaspaceAux::committed_bytes(Metaspace::ClassType) +
4011       (metaspace->class_chunk_size(word_size) * BytesPerWord) >
4012       CompressedClassSpaceSize;
4013   }
4014 
4015   // -XX:+HeapDumpOnOutOfMemoryError and -XX:OnOutOfMemoryError support
4016   const char* space_string = out_of_compressed_class_space ?
4017     "Compressed class space" : "Metaspace";




3977   return result;
3978 }
3979 
3980 size_t Metaspace::class_chunk_size(size_t word_size) {
3981   assert(using_class_space(), "Has to use class space");
3982   return class_vsm()->calc_chunk_size(word_size);
3983 }
3984 
3985 void Metaspace::report_metadata_oome(ClassLoaderData* loader_data, size_t word_size, MetaspaceObj::Type type, MetadataType mdtype, TRAPS) {
3986   tracer()->report_metadata_oom(loader_data, word_size, type, mdtype);
3987 
3988   // If result is still null, we are out of memory.
3989   Log(gc, metaspace, freelist) log;
3990   if (log.is_info()) {
3991     log.info("Metaspace (%s) allocation failed for size " SIZE_FORMAT,
3992              is_class_space_allocation(mdtype) ? "class" : "data", word_size);
3993     ResourceMark rm;
3994     if (log.is_debug()) {
3995       if (loader_data->metaspace_or_null() != NULL) {
3996         LogStream ls(log.debug());
3997         loader_data->print_value_on(&ls);
3998       }
3999     }
4000     LogStream ls(log.info());
4001     MetaspaceAux::dump(&ls);
4002     MetaspaceAux::print_metaspace_map(&ls, mdtype);
4003     ChunkManager::print_all_chunkmanagers(&ls);
4004   }
4005 
4006   bool out_of_compressed_class_space = false;
4007   if (is_class_space_allocation(mdtype)) {
4008     Metaspace* metaspace = loader_data->metaspace_non_null();
4009     out_of_compressed_class_space =
4010       MetaspaceAux::committed_bytes(Metaspace::ClassType) +
4011       (metaspace->class_chunk_size(word_size) * BytesPerWord) >
4012       CompressedClassSpaceSize;
4013   }
4014 
4015   // -XX:+HeapDumpOnOutOfMemoryError and -XX:OnOutOfMemoryError support
4016   const char* space_string = out_of_compressed_class_space ?
4017     "Compressed class space" : "Metaspace";


< prev index next >