From 5795920f0a0d430cdde7ce7d7e15d39b5b848ebc Mon Sep 17 00:00:00 2001 From: poonam Date: Wed, 28 May 2014 06:26:05 -0700 Subject: [PATCH] 8043086: Hotspot is expected to report OOM which is occurred String.intern(), but crashes in JDK8u5 Summary: In case of allocation failure, restore the value of _chunk in Arena Reviewed-by: dholmes, dcubed --- src/share/vm/memory/allocation.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/share/vm/memory/allocation.cpp b/src/share/vm/memory/allocation.cpp index abba20bcd..5bc2bc163 100644 --- a/src/share/vm/memory/allocation.cpp +++ b/src/share/vm/memory/allocation.cpp @@ -561,6 +561,7 @@ void* Arena::grow(size_t x, AllocFailType alloc_failmode) { _chunk = new (alloc_failmode, len) Chunk(len); if (_chunk == NULL) { + _chunk = k; // restore the previous value of _chunk return NULL; } if (k) k->set_next(_chunk); // Append new chunk to end of linked list -- GitLab