summaryrefslogtreecommitdiffstats
path: root/runtime/gc
Commit message (Collapse)AuthorAgeFilesLines
* Merge "Improve GSS reference processing."Hiroshi Yamauchi2014-04-294-7/+32
|\
| * Improve GSS reference processing.Hiroshi Yamauchi2014-04-284-7/+32
| | | | | | | | | | | | | | | | | | Support the case where the reference object is in the free list space and the referent object is in the bump pointer space at a bump pointer space collection. Bug: 11650816 Change-Id: If98b08edc9e37351c74ee07cb3f2d30c2b4d0056
* | Always log explicit GC.Mathieu Chartier2014-04-284-30/+30
|/ | | | | | | | People who use DDMS want to see that a GC actually occurs when they press GC button. Bug: 14325353 Change-Id: I44e0450c92abf7223d33552ed37f626fe63e1c28
* Fix racy DCHECKS.Mathieu Chartier2014-04-281-2/+6
| | | | | | | | | Added a size bracket lock to fix a race condition where we were inserting into full_runs_ and non_full_runs_ holding a lock but reading without holding a lock from a different thread. Bug: 14326370 Change-Id: I5c492bddc4b9927e4a36603f3d787b046961675d
* Rosalloc: fix signature for 64bAndreas Gampe2014-04-251-1/+1
| | | | Change-Id: I56df1df0118a0aa1584e51fb574902f7eb88cd80
* Enable reading page map without lock in RosAlloc::BulkFreeMathieu Chartier2014-04-259-370/+438
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Enabling this flag greatly reduces how much time was spent in the GC. It was not done previously since it was regressing MemAllocTest. With these RosAlloc changes, the benchmark score no longer regresses after we enable the flag. Changed Run::AllocSlot to only have one mode of allocation. The new mode is finding the first free bit in the bitmap. This was previously the slow path but is now the fast path. Some optimizations which enabled this include always having the alloc bitmap bits which correspond to invalid slots be set to 1. This prevents us from needing a bound check since we will never end up allocating there. Changed revoking thread local buffer to point to an invalid run. The invalid run is just a run which always has all the allocation bits set to 1. When a thread attempts to do a thread local allocation from here it will always fail and go slow path. This eliminates the need for a null check for revoked runs. Changed zeroing of memory to happen during free, AllocPages should always return zeroed memory. Added prefetching which happens when we allocate a run. Some refactoring to reduce duplicated code. Ergonomics changes: Changed kStickyGcThroughputAdjustment to 1.0, this helps reduce GC time. Measurements (3 samples per benchmark): Before: MemAllocTest scores: 3463, 3445, 3431 EvaluateAndApplyChanges score | total GC time Iter 1: 3485, 23.602436s Iter 2: 3434, 22.499882s Iter 3: 3483, 23.253274s After: MemAllocTest scores: 3495, 3417, 3409 EvaluateAndApplyChanges score | total GC time: Iter 1: 3375, 17.463462s Iter 2: 3358, 16.185188s Iter 3: 3367, 15.822312s Bug: 8788501 Bug: 11790317 Bug: 9986565 Change-Id: Ifd273a054824028dabed27c07c081dde1816f93c
* Don't allow heap transitions if the runtime is shutting down.Mathieu Chartier2014-04-231-0/+5
| | | | | Bug: 14254222 Change-Id: I97ac988a96b56a8dc1eec018bf3ef7a691f04745
* Return bytes freed from RosAlloc.Mathieu Chartier2014-04-223-39/+46
| | | | | | | | | | There was a problem with how RosAlloc space sweeping worked caused by using the object size in the FreeList call, this won't work well with class unloading since the object's class may be freed before the object. Bug: 13989231 Change-Id: I3df439c312310720fd34249334dec85030166fe9
* Replace ObjectSet with LargeObjectBitmap.Mathieu Chartier2014-04-1720-377/+355
| | | | | | | | | | | | | | | | | | | | | | | Speeds up large object marking since large objects no longer required a lock. Changed the GCs to use the heap bitmap for marking objects which aren't in the fast path. This eliminates the need for a MarkLargeObject function. Maps before (10 GC iterations): Mean partial time: 180ms Mean sticky time: 151ms Maps after: Mean partial time: 161ms Mean sticky time: 101ms Note: the GC durations are long due to recent ergonomic changes and because the fast bulk free hasn't yet been enabled. Over 50% of the GC time is spent in RosAllocSpace::FreeList. Bug: 13571028 Change-Id: Id8f94718aeaa13052672ccbae1e8edf77d653f62
* Use non volatile lock words in semispace collector.Mathieu Chartier2014-04-173-16/+22
| | | | | | | | | | GSS FormulaEvaluationActions.EvaluateAndApplyChanges: Before GC time: 9.1s After GC time: 7.98s Fixed timing logger errors. Change-Id: I4193c6ccbbbe7a7220dfaabbf3472a5dcebae616
* Decrease target utilization for foreground apps.Mathieu Chartier2014-04-162-14/+35
| | | | | | | | | | GC time in FormulaEvaluationActions.EvaluateAndApplyChanges goes from 26.1s to 23.2s. Benchmark score goes down ~50 in FormulaEvaluationActions.EvaluateAndApplyChanges, and up ~50 in GenericCalcActions.MemAllocTest. Bug: 8788501 Change-Id: I412af1205f8b67e70a12237c990231ea62167bc0
* Less confusing heap transition message.Mathieu Chartier2014-04-151-8/+1
| | | | | | | The heap transition message now just says how long the transition took and up to how much memory was saved (it can still be negative). Change-Id: If421dcc2aa9cc40740b858dcc2ff1b8e595f9a40
* Don't call SetFootprintLimit in CreateZygoteSpace.Mathieu Chartier2014-04-151-9/+4
| | | | | | | | | | | | | Since SetFootprintLimit uses the allocators accounting it can set a word inside of the zygote space mem map. This was causing issues since it was occasionally clobbering one of the object classes. This occured since we compact objects into the space which was used by the allocator's internal accounting during zygote bin packing. Also addressed some TODO. Bug: 14056343 Change-Id: I9fc5a61174fa141c0f44d0ed0ae0cc6d77cb4e0a
* Fix clang build.Mathieu Chartier2014-04-142-7/+6
| | | | Change-Id: Iaf0b76cfc02bac5f49ab98d494db9a774211f453
* Merge "Refactor space bitmap to support different alignments."Mathieu Chartier2014-04-1433-233/+251
|\
| * Refactor space bitmap to support different alignments.Mathieu Chartier2014-04-1433-233/+251
| | | | | | | | | | | | | | | | | | | | | | Required for: Using space bitmaps instead of std::set in mod union table + remembered set. Using a bitmap instead of set for large object marking. Bug: 13571028 Change-Id: Id024e9563d4ca4278f79607cdb2f81895121b113
* | Reduce bump pointer space capacity.Mathieu Chartier2014-04-141-2/+7
|/ | | | | Bug: 14058912 Change-Id: I7ae53e667539530d56ca2f5d10214e69c9c994e2
* Fix hammerhead phone boot on master.Mathieu Chartier2014-04-111-1/+1
| | | | | | Wasn't failing on AOSP. Change-Id: I8e531bf7493d36dc2667afeaf3133ce8560a2ce1
* Fix heap verification with SS/GSS.Mathieu Chartier2014-04-112-1/+5
| | | | | | | | | | Since I had removed the SwapSemiSpaces it was trying to verify references in the from space of the semispace collector, which isn't necessarily valid. Bug: 13989162 Change-Id: I8e0b7119a1a53d63f2c71ecdb276290eda5bae07
* Merge "Fix an occasional ThreadStress crash."Hiroshi Yamauchi2014-04-111-4/+5
|\
| * Fix an occasional ThreadStress crash.Hiroshi Yamauchi2014-04-111-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | Also, fix the NativeAllocations test for the case with the GSS collector as the default GC. Since kGcCauseForAlloc (incorrect) was being passed into the collector instead of kGcCauseForNativeAlloc (correct) from Heap::RegisterNativeAllocation(), the GCC collector never invoked a whole heap collection which was necessary to do sufficent finalizations to pass the test. Bug: 13988451 Bug: 11650816 Change-Id: Ib02f061751cd777e0d3bfa81b29e04a874dc58a0
* | Clean-up heap spaces.Mathieu Chartier2014-04-1125-287/+316
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We now use the CMS collector instead of the semispace collector when the phone is booting. We still perform compaction during the zygote space creation. This reduces time spent in GC by ~2s during boot and doesn't affect zygote space size. Changed the space creation logic to create the temp space when a background transition occurs. Added a flag to each space which is true if you are allowed to move objects that are within this space. Removed SwapSemiSpaces call from the semi space collector, it is now the job of the caller to do this with threads suspended. This simplifies the logic in the zygote compaction / heap transition code since these do not copy from one semispace to another. Added Space::Clear to RosAllocSpace and DlMallocSpace. This greatly simplifies the code used for collector transitions. Time spent in GC creating zygote space: Before: 3.4s, After: 1.28s No change in zygote space size. Bug: 13878055 Change-Id: I700348ab7d5bf3aa537c0cd70c0fed09aa4b0623
* | Fix race condition in TransitionCollector.Mathieu Chartier2014-04-101-0/+7
|/ | | | | | | | | | There was a race condition where if multiple threads were calling TransitionCollector it could cause a crash due to an invalid collector transition if another thread did the collector transition before the SuspendAll. Bug: 13929101 Change-Id: I8c162a83c1f53d0cbdefab62b0a5bcbb151d6c42
* Add mean GC duration to DumpGcPerformanceInfo.Mathieu Chartier2014-04-091-3/+4
| | | | Change-Id: Ibd68e9d8cae71d0ceb769fc975f1148287e9ca4a
* Merge "Adjust sticky GC ergonomics."Mathieu Chartier2014-04-091-1/+5
|\
| * Adjust sticky GC ergonomics.Mathieu Chartier2014-04-091-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | Added an adjustment factor that causes sticky GC to occur more often. Currently, we adjust the throughput by 5 / 4 comapred to the non sticky GC. This improves the MemAllocTest score by 50-100. I believe this happens since the sticky GC uses less memory bandwidth than partial/full GC. No benchmark score regression on EvaluateAndApplyChanges though total GC time is increased by ~0.5s. Bug: 13818507 Change-Id: Ic721a1bff069ddaf8acc55e776b8bc26e171d46e
* | Merge "GSS: Fix the bump pointer space only collection."Hiroshi Yamauchi2014-04-094-16/+62
|\ \ | |/ |/|
| * GSS: Fix the bump pointer space only collection.Hiroshi Yamauchi2014-04-084-16/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes b/13912464 where the clear soft reference behavior accidentally disabled the bump pointer space only collection. Changed the collector name so that the GC logs would indicate the generational mode and the collection mode. Peformance enhancement: instead of triggering the whole heap collection every 5 collections, count the bytes promoted since the last whole heap collection and use it to decide when to trigger the whole heap collection. This improves MemAllocTest by 5-10% (N4 and host). Bug: 13912464 Bug: 11650816 Bug: 9986565 Change-Id: I653a0dca62a8b54adf69abe2940a41eac70f809b
* | Reset GC timings after SIGQUIT.Mathieu Chartier2014-04-083-1/+13
| | | | | | | | | | | | | | | | We now reset the GC timings when a SIGQUIT happens, this is useful for excluding GCs which happen during the initialization of an app when measuring GC performance. Change-Id: I68c79bdb279290c12ae588bc7e95ac24908c157e
* | Merge "Implement rosalloc page trimming without suspending threads."Hiroshi Yamauchi2014-04-073-4/+59
|\ \
| * | Implement rosalloc page trimming without suspending threads.Hiroshi Yamauchi2014-04-073-4/+59
| |/ | | | | | | | | | | | | Also, making it more efficient by not going through the chunks smaller than the page size by not using InspectAll(). Change-Id: I79ceb0374cb8aba5f6b8dde1afbace9af98b6cff
* | Add monitor deflation.Mathieu Chartier2014-04-072-16/+24
|/ | | | | | | | | | | We now deflate the monitors when we perform a heap trim. This causes a pause but it shouldn't matter since we should be in a state where we don't care about pauses. Memory savings are hard to measure. Fixed integer overflow bug in GetEstimatedLastIterationThroughput. Bug: 13733906 Change-Id: I4e0e68add02e7f43370b3a5ea763d6fe8a5b212c
* Improve invalid root dumping.Mathieu Chartier2014-04-043-10/+13
| | | | | | The invalid root dumping now attempts to print the root type. Change-Id: Ie821296d569f34909ba6e2705f5c347cd2143a3a
* Merge "Insert an empty read barrier call."Hiroshi Yamauchi2014-04-041-2/+7
|\
| * Insert an empty read barrier call.Hiroshi Yamauchi2014-04-031-2/+7
| | | | | | | | | | Bug: 12687968 Change-Id: Ie1d28658e16e09f6a983cb5c1f0d5b375b7ae069
* | Merge "Fix Object::Clone()'s pre-fence barrier."Hiroshi Yamauchi2014-04-043-13/+22
|\ \
| * | Fix Object::Clone()'s pre-fence barrier.Hiroshi Yamauchi2014-04-033-13/+22
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | Pass in a pre-fence barrier object that sets in the array length instead of setting it after returning from AllocObject(). Fix another potential bug due to the wrong default pre-fence barrier parameter value. Since this appears error-prone, removed the default parameter value and make it an explicit parameter. Fix another potential moving GC bug due to a lack of a SirtRef. Bug: 13097759 Change-Id: I466aa0e50f9e1a5dbf20be5a195edee619c7514e
* | Fix off-by-1 error in new SpaceBitmapAndreas Gampe2014-04-033-2/+93
| | | | | | | | | | | | Do not visit_end in the VisitMarkedRange code. Change-Id: Iaf02788509b21a102cd1c0e2db3cbd09d0522bfa
* | Make SpaceBitmap cross-compiling tolerantAndreas Gampe2014-04-023-79/+85
|/ | | | | | | | Change the order of bits in SpaceBitmap to be the intuitive one: Offset 0 is bit 0, instead of the MSB. Then compiling on 32b for 64b works as expected. Change-Id: Iee2491eaf06d4b5f8b534b7c980d5719633cb64c
* Pass instruction-set from runtime through to spawned dex2oat.Ian Rogers2014-04-021-30/+2
| | | | Change-Id: I1727af7beb9f710c29124d4d6bc9175e4856f3cc
* Merge "Fix running with DlMalloc instead of RosAlloc."Mathieu Chartier2014-04-013-4/+3
|\
| * Fix running with DlMalloc instead of RosAlloc.Mathieu Chartier2014-04-013-4/+3
| | | | | | | | | | | | | | Bug: 13748830 Bug: 13744490 Change-Id: Ieec97cf58ebf9864a40ee85aae582cdcf3f27c0c
* | Merge "Make the support code for read barriers a bit more general."Hiroshi Yamauchi2014-04-017-27/+31
|\ \ | |/ |/|
| * Make the support code for read barriers a bit more general.Hiroshi Yamauchi2014-03-317-27/+31
| | | | | | | | | | | | | | Add an option for Baker in addition to Brooks. Bug: 12687968 Change-Id: I8a31db817ff6686c72951b6534f588228e270b11
* | Merge "Fix stack overflow slow path error."Mathieu Chartier2014-04-011-1/+1
|\ \
| * | Fix stack overflow slow path error.Mathieu Chartier2014-03-311-1/+1
| |/ | | | | | | | | | | | | | | | | | | The frame size without spill was being passed into the slow path instead of the spill size. This was incorrect since only the spills will have been pushed at the point of the overflow check. Also addressed an other comment. Change-Id: Ic6e455122473a8f796b291d71f945bcf72788662
* | Allow mixing of thread offsets between 32 and 64bit architectures.Ian Rogers2014-04-012-12/+12
|/ | | | | | | Begin a more full implementation x86-64 REX prefixes. Doesn't implement 64bit thread offset support for the JNI compiler. Change-Id: If9af2f08a1833c21ddb4b4077f9b03add1a05147
* Merge "Fix a DCHECK failure when causing GC from DDMS."Hiroshi Yamauchi2014-03-312-17/+41
|\
| * Fix a DCHECK failure when causing GC from DDMS.Hiroshi Yamauchi2014-03-282-17/+41
| | | | | | | | | | Bug: 13647069 Change-Id: Iae2746b2b7b4493fcf5f0d40d2bf36a9b2d2efc8
* | Fix non concurrent mark sweep ergonomics.Mathieu Chartier2014-03-281-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously we would continue to do sticky GC until the sticky GC did not free enough memory for the allocation, this was excessive since it could do one sticky GC per allocation. The new logic uses the next GC type before trying all the GCs in the plan. Before memalloc benchmark (non concurrent mark sweep): Total time spent in GC: 11.212701s Score: 7790 After: Total time spent in GC: 9.422676s Score: 6870 Change-Id: Iba75b70ea825ef3fd4b3e064d4f12c2fe5a3b176