--- old/src/share/vm/code/codeCache.cpp 2014-10-13 14:38:39.746022795 +0200 +++ new/src/share/vm/code/codeCache.cpp 2014-10-13 14:38:39.662022799 +0200 @@ -758,9 +758,14 @@ * Returns true if a CodeHeap is full and sets code_blob_type accordingly. */ bool CodeCache::is_full(int* code_blob_type) { - FOR_ALL_HEAPS(heap) { - if ((*heap)->unallocated_capacity() < CodeCacheMinimumFreeSpace) { - *code_blob_type = (*heap)->code_blob_type(); + FOR_ALL_HEAPS(heap_iterator) { + CodeHeap* heap = *heap_iterator; + // Do not check the non-nmethod code heap because we can store + // non-nmethod code in the non-profiled code heap (see comment + // 'fallback solution' in CodeCache::allocate). + if (heap->code_blob_type() != CodeBlobType::NonNMethod && + heap->unallocated_capacity() < CodeCacheMinimumFreeSpace) { + *code_blob_type = heap->code_blob_type(); return true; } } @@ -1013,7 +1018,7 @@ if (SegmentedCodeCache) { warning("%s is full. Compiler has been disabled.", CodeCache::get_code_heap_name(code_blob_type)); warning("Try increasing the code heap size using -XX:%s=", - (code_blob_type == CodeBlobType::MethodNonProfiled) ? "NonProfiledCodeHeapSize" : "ProfiledCodeHeapSize"); + (code_blob_type == CodeBlobType::MethodProfiled) ? "ProfiledCodeHeapSize" : "NonProfiledCodeHeapSize"); } else { warning("CodeCache is full. Compiler has been disabled."); warning("Try increasing the code cache size using -XX:ReservedCodeCacheSize=");