< prev index next >

src/hotspot/share/gc/parallel/parallelScavengeHeap.cpp

Print this page
rev 50095 : [mq]: allocations-rt.patch

*** 35,44 **** --- 35,45 ---- #include "gc/parallel/psMemoryPool.hpp" #include "gc/parallel/psParallelCompact.inline.hpp" #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" #include "logging/log.hpp" #include "oops/oop.inline.hpp"
*** 228,249 **** // simultaneously. When that happens, only one VM operation will succeed, // and the rest will not be executed. For that reason, this method loops // 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, 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"); // 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); uint loop_count = 0; uint gc_count = 0; uint gclocker_stalled_count = 0; --- 229,255 ---- // simultaneously. When that happens, only one VM operation will succeed, // and the rest will not be executed. For that reason, this method loops // 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, 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; ! result = young_gen()->allocate(size); uint loop_count = 0; uint gc_count = 0; uint gclocker_stalled_count = 0;
< prev index next >