From ac195160c299f1c7a87144da7dccb9411df3c1fd Mon Sep 17 00:00:00 2001 From: Mathieu Chartier Date: Fri, 20 Feb 2015 18:44:28 +0000 Subject: [PATCH] Revert "Do GC for alloc for unstarted runtimes" Bug: 19451379 This reverts commit c0a7e2bb1609da40ec67cb7e00c918637c610897. Change-Id: Ib079e5ce1647fd44239f7f2f658b2c50d619fece --- runtime/gc/heap.cc | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/runtime/gc/heap.cc b/runtime/gc/heap.cc index 452980cf7..419d5558a 100644 --- a/runtime/gc/heap.cc +++ b/runtime/gc/heap.cc @@ -3154,12 +3154,8 @@ void Heap::ClearConcurrentGCRequest() { } void Heap::RequestConcurrentGC(Thread* self) { - // If we don't have a started runtime, then we don't have a thread which is running the heap - // tasks. In this case, do the GC in the allocating thread to ensure that memory gets freed. - if (!Runtime::Current()->IsFinishedStarting()) { - CollectGarbageInternal(collector::kGcTypeFull, kGcCauseForAlloc, false); - } else if (CanAddHeapTask(self) && - concurrent_gc_pending_.CompareExchangeStrongSequentiallyConsistent(false, true)) { + if (CanAddHeapTask(self) && + concurrent_gc_pending_.CompareExchangeStrongSequentiallyConsistent(false, true)) { task_processor_->AddTask(self, new ConcurrentGCTask(NanoTime())); // Start straight away. } } -- 2.11.0