--- old/src/hotspot/share/gc/parallel/parallelScavengeHeap.cpp 2018-05-09 00:05:45.735194441 +0200 +++ new/src/hotspot/share/gc/parallel/parallelScavengeHeap.cpp 2018-05-09 00:05:45.594196188 +0200 @@ -37,6 +37,7 @@ #include "gc/parallel/psPromotionManager.hpp" #include "gc/parallel/psScavenge.hpp" #include "gc/parallel/vmPSOperations.hpp" +#include "gc/shared/collectedHeap.inline.hpp" #include "gc/shared/gcHeapSummary.hpp" #include "gc/shared/gcLocker.hpp" #include "gc/shared/gcWhen.hpp" @@ -230,18 +231,23 @@ // during failed allocation attempts. If the java heap becomes exhausted, // we rely on the size_policy object to force a bail out. HeapWord* ParallelScavengeHeap::mem_allocate( - size_t size, + size_t size, Klass* klass, Thread* thread, bool* gc_overhead_limit_was_exceeded) { assert(!SafepointSynchronize::is_at_safepoint(), "should not be at safepoint"); assert(Thread::current() != (Thread*)VMThread::vm_thread(), "should not be in vm thread"); assert(!Heap_lock->owned_by_self(), "this thread should not own the Heap_lock"); + HeapWord* result = allocate_from_tlab(klass, thread, size); + if (result != NULL) { + return result; + } + // In general gc_overhead_limit_was_exceeded should be false so // set it so here and reset it to true only if the gc time // limit is being exceeded as checked below. *gc_overhead_limit_was_exceeded = false; - HeapWord* result = young_gen()->allocate(size); + result = young_gen()->allocate(size); uint loop_count = 0; uint gc_count = 0;