src/share/vm/memory/metaspace.cpp

changeset 5808
bc918fd1e584
parent 5774
03f493ce3a71
child 5863
85c1ca43713f
equal deleted inserted replaced
5807:c319b188c7b2 5808:bc918fd1e584
3102 } 3102 }
3103 3103
3104 MetaWord* Metaspace::allocate(size_t word_size, MetadataType mdtype) { 3104 MetaWord* Metaspace::allocate(size_t word_size, MetadataType mdtype) {
3105 // DumpSharedSpaces doesn't use class metadata area (yet) 3105 // DumpSharedSpaces doesn't use class metadata area (yet)
3106 // Also, don't use class_vsm() unless UseCompressedClassPointers is true. 3106 // Also, don't use class_vsm() unless UseCompressedClassPointers is true.
3107 if (mdtype == ClassType && using_class_space()) { 3107 if (is_class_space_allocation(mdtype)) {
3108 return class_vsm()->allocate(word_size); 3108 return class_vsm()->allocate(word_size);
3109 } else { 3109 } else {
3110 return vsm()->allocate(word_size); 3110 return vsm()->allocate(word_size);
3111 } 3111 }
3112 } 3112 }
3250 SIZE_FORMAT, word_size); 3250 SIZE_FORMAT, word_size);
3251 if (loader_data->metaspace_or_null() != NULL) loader_data->dump(gclog_or_tty); 3251 if (loader_data->metaspace_or_null() != NULL) loader_data->dump(gclog_or_tty);
3252 MetaspaceAux::dump(gclog_or_tty); 3252 MetaspaceAux::dump(gclog_or_tty);
3253 } 3253 }
3254 // -XX:+HeapDumpOnOutOfMemoryError and -XX:OnOutOfMemoryError support 3254 // -XX:+HeapDumpOnOutOfMemoryError and -XX:OnOutOfMemoryError support
3255 const char* space_string = (mdtype == ClassType) ? "Compressed class space" : 3255 const char* space_string = is_class_space_allocation(mdtype) ? "Compressed class space" :
3256 "Metadata space"; 3256 "Metadata space";
3257 report_java_out_of_memory(space_string); 3257 report_java_out_of_memory(space_string);
3258 3258
3259 if (JvmtiExport::should_post_resource_exhausted()) { 3259 if (JvmtiExport::should_post_resource_exhausted()) {
3260 JvmtiExport::post_resource_exhausted( 3260 JvmtiExport::post_resource_exhausted(
3261 JVMTI_RESOURCE_EXHAUSTED_OOM_ERROR, 3261 JVMTI_RESOURCE_EXHAUSTED_OOM_ERROR,
3262 space_string); 3262 space_string);
3263 } 3263 }
3264 if (mdtype == ClassType) { 3264 if (is_class_space_allocation(mdtype)) {
3265 THROW_OOP_0(Universe::out_of_memory_error_class_metaspace()); 3265 THROW_OOP_0(Universe::out_of_memory_error_class_metaspace());
3266 } else { 3266 } else {
3267 THROW_OOP_0(Universe::out_of_memory_error_metaspace()); 3267 THROW_OOP_0(Universe::out_of_memory_error_metaspace());
3268 } 3268 }
3269 } 3269 }

mercurial