--- a/hotspot/src/share/vm/code/codeBlob.cpp Mon Feb 15 20:02:51 2016 +0300
+++ b/hotspot/src/share/vm/code/codeBlob.cpp Mon Feb 15 20:26:02 2016 +0300
@@ -291,6 +291,9 @@
{
MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
blob = new (size) MethodHandlesAdapterBlob(size);
+ if (blob == NULL) {
+ vm_exit_out_of_memory(size, OOM_MALLOC_ERROR, "CodeCache: no room for method handle adapter blob");
+ }
}
// Track memory usage statistic after releasing CodeCache_lock
MemoryService::track_code_cache_memory_usage();