summaryrefslogtreecommitdiffstats
path: root/runtime/gc
Commit message (Collapse)AuthorAgeFilesLines
* Fix force copyMathieu Chartier2015-06-241-1/+1
| | | | | | | | | We now correctly pass the returned pointer back onto the release functions. Bug: 22056708 Change-Id: I1a7300d3a4522a3c81b432ec742ae1c0bd00b51e (cherry picked from commit b735bd9c04aa291d0a1bdc2c0a094a1a75ad0596)
* New experimental GC stress modeMathieu Chartier2015-06-223-6/+113
| | | | | | | | | | | | | | | Tries to do a GC for every unique call stack (up to 16 frames). The goal is to catch moving GC bugs and lock violations without being rediculously slow. Some tests fail on 64 bits, 32 bit host doesn't work. N5 is booting. Added runtime -Xgc options: gcstress and nogcstress. Bug: 21664466 (cherry picked from commit 310008008c90fea246efd00cb99ee7ded97c5209) Change-Id: Icb8e420f2048e8ee83bcca7937563166a2638f5c
* Change GC to allow strings to use large object space.Jeff Hao2015-06-221-1/+1
| | | | | Bug: 21209641 Change-Id: Ib007a30e575e391e2b5bddb816a9d2e82502c7d5
* ART stack unwinding fixes for libunwind/gdb/lldb.David Srbecky2015-06-193-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dex2oat can already generate unwinding and symbol information which allows tools to create backtrace of mixed native and Java code. This is a cherry pick from aosp/master which fixes several issues. Most notably: * It enables generation of ELF-64 on 64-bit systems (in dex2oat, C compilers already produce ELF-64). Libunwind requires ELF-64 on 64-bit systems for backtraces to work. * It enables loading of ELF files with dlopen. This is required for libunwind to be able to generate backtrace of current process (i.e. the process requesting backtrace of itself). * It adds unit test to test the above (32 vs 64 bit, in-proces vs out-of-process, application code vs framework code). * Some other fixes or clean-ups which should not be of much significance but which are easier to include to make the important CLs cherry-pick cleanly. This is squash of the following commits from aosp/master: 7381010 ART: CFI Test e1bbed2 ART: Blacklist CFI test for non-compiled run-tests aab9f73 ART: Blacklist CFI test for JIT 4437219 ART: Blacklist CFI test for Heap Poisoning a3a49fe Switch to using ELF-64 for 64-bit architectures. 297ed22 Write 64-bit address in DWARF if we are on 64-bit architecture. 24981a1 Set correct size of PT_PHDR ELF segment. 1a146bf Link .dynamic to .dynstr 67a0653 Make some parts of ELF more (pointer) aligned. f50fa82 Enable 64-bit CFI tests. 49e1fab Use dlopen to load oat files. 5dedb80 Add more logging output for dlopen. aa03870 Find the dlopened file using address rather than file path. 82e73dc Release dummy MemMaps corresponding to dlopen. 5c40961 Test that we can unwind framework code. 020c543 Add more log output to the CFI test. 88da3b0 ART: Fix CFI test wrt/ PIC a70e5b9 CFI test: kill the other process in native code. ad5fa8c Support generation of CFI in .debug_frame format. 90688ae Fix build - large frame size of ElfWriterQuick<ElfTypes>::Write. 97dabb7 Fix build breakage in dwarf_test. 388d286 Generate just single ARM mapping symbol. f898087 Split .oat_patches to multiple sections. 491a7fe Fix build - large frame size of ElfWriterQuick<ElfTypes>::Write (again). 8363c77 Add --generate-debug-info flag and remove the other two flags. 461d72a Generate debug info for core.oat files. Bug: 21924613 Change-Id: I3f944a08dd2ed1df4d8a807da4fee423fdd35eb7
* Merge "Move image intern table into image" into mnc-devMathieu Chartier2015-06-114-7/+14
|\
| * Move image intern table into imageMathieu Chartier2015-06-114-7/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | Previously we recreated this intern table during runtime startup. This added 50-100ms of boot time. Fixed bug where we didn't copy over hashcodes into the image. Deleted some stale code. Bug: 20727525 Bug: 19569780 Change-Id: I08959e9aa2a73cedb52f393033e2ffea3a26e76b
* | Reset GC performance stats at zygote fork.Hiroshi Yamauchi2015-06-102-0/+22
|/ | | | | | | So GCs before a zygote fork won't be attributed to an app. Bug: 21491908 Change-Id: Ib37bc587e0f039ef8faeabe63dec19de49501863
* Use runFinalizationWithTimeout for native allocationsMathieu Chartier2015-06-052-15/+12
| | | | | | | | Prevents deadlocks by not waiting longer than 250ms for finalizers to complete. Bug: 21544853 Change-Id: I57b2f7ae8b74185922eb3c15ba0ab71a4d2348aa
* Add atrace calls to runtime start and heap createRichard Uhler2015-06-041-5/+12
| | | | | | Bug: 20727525 Change-Id: I91a74b793fb9eda8ed580244a6a5fd313ef2eb27
* Fix valgrind large_object_space_testMathieu Chartier2015-06-032-13/+23
| | | | | | Also some cleanup. Change-Id: I9c1a8093e6356f1b52e332009429b77fa5c1d448
* Add a way to determine if a large object is a zygote objectMathieu Chartier2015-06-034-34/+105
| | | | | | | Also fix a slight memory leak in LargeObjectMapSpace. Bug: 20674158 Change-Id: I2416df484e5b84a8c5cc0b5664c8cb102dc235f6
* Move mirror::ArtMethod to nativeMathieu Chartier2015-06-029-45/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Optimizing + quick tests are passing, devices boot. TODO: Test and fix bugs in mips64. Saves 16 bytes per most ArtMethod, 7.5MB reduction in system PSS. Some of the savings are from removal of virtual methods and direct methods object arrays. Bug: 19264997 (cherry picked from commit e401d146407d61eeb99f8d6176b2ac13c4df1e33) Change-Id: I622469a0cfa0e7082a2119f3d6a9491eb61e3f3d Fix some ArtMethod related bugs Added root visiting for runtime methods, not currently required since the GcRoots in these methods are null. Added missing GetInterfaceMethodIfProxy in GetMethodLine, fixes --trace run-tests 005, 044. Fixed optimizing compiler bug where we used a normal stack location instead of double on ARM64, this fixes the debuggable tests. TODO: Fix JDWP tests. Bug: 19264997 Change-Id: I7c55f69c61d1b45351fd0dc7185ffe5efad82bd3 ART: Fix casts for 64-bit pointers on 32-bit compiler. Bug: 19264997 Change-Id: Ief45cdd4bae5a43fc8bfdfa7cf744e2c57529457 Fix JDWP tests after ArtMethod change Fixes Throwable::GetStackDepth for exception event detection after internal stack trace representation change. Adds missing ArtMethod::GetInterfaceMethodIfProxy call in case of proxy method. Bug: 19264997 Change-Id: I363e293796848c3ec491c963813f62d868da44d2 Fix accidental IMT and root marking regression Was always using the conflict trampoline. Also included fix for regression in GC time caused by extra roots. Most of the regression was IMT. Fixed bug in DumpGcPerformanceInfo where we would get SIGABRT due to detached thread. EvaluateAndApplyChanges: From ~2500 -> ~1980 GC time: 8.2s -> 7.2s due to 1s less of MarkConcurrentRoots Bug: 19264997 Change-Id: I4333e80a8268c2ed1284f87f25b9f113d4f2c7e0 Fix bogus image test assert Previously we were comparing the size of the non moving space to size of the image file. Now we properly compare the size of the image space against the size of the image file. Bug: 19264997 Change-Id: I7359f1f73ae3df60c5147245935a24431c04808a [MIPS64] Fix art_quick_invoke_stub argument offsets. ArtMethod reference's size got bigger, so we need to move other args and leave enough space for ArtMethod* and 'this' pointer. This fixes mips64 boot. Bug: 19264997 Change-Id: I47198d5f39a4caab30b3b77479d5eedaad5006ab
* ART: Clean up arm64 kNumberOfXRegisters usage.Vladimir Marko2015-05-2622-8/+25
| | | | | | | | | | | | | | | | | | | | | Avoid undefined behavior for arm64 stemming from 1u << 32 in loops with upper bound kNumberOfXRegisters. Create iterators for enumerating bits in an integer either from high to low or from low to high and use them for <arch>Context::FillCalleeSaves() on all architectures. Refactor runtime/utils.{h,cc} by moving all bit-fiddling functions to runtime/base/bit_utils.{h,cc} (together with the new bit iterators) and all time-related functions to runtime/base/time_utils.{h,cc}. Improve test coverage and fix some corner cases for the bit-fiddling functions. Bug: 13925192 (cherry picked from commit 80afd02024d20e60b197d3adfbb43cc303cf29e0) Change-Id: I905257a21de90b5860ebe1e39563758f721eab82
* Fix for potential moving GC bugs around proxy class.Hiroshi Yamauchi2015-05-221-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | - Handlerize proxy_class which is live across multiple allocation points in ClassLinker::CreateProxyClass(). - In ClassLinker::CreateProxyClass(), insert a proxy class into the class table before creating ArtFields for it (and update it later in LinkClass()) because the field roots (ArtField::declaring_class_) won't be updated by GC unless the class is in the class table. If GC happens before they are updated by FixupTemporaryDeclaringClass() from LinkClass(), FixupTemporaryDeclaringClass() may not update the field roots correctly because the old class may already be moved but the fields roots may not. Reduce a window of time where the fields roots could be stale. - In ClassLinker::LinkClass(), directly wrap a new class in a handle to avoid a window of time where new_class may be potentially stale. - Print more diagnostic info about the holder of the field upon a mark sweep invalid ref crash. - Add an additional sanity check in Field::GetArtField(). Bug: 20557050 Change-Id: I9ad32d304922da96b7e1fad262d97de21cbac776
* Fix debuggable compiler flag detection for secondary dex filesSebastien Hertz2015-05-191-0/+3
| | | | | | | | | | | | | | | | | | Compiles secondary dex files like the primary dex file: if it has been compiled with the --debuggable flag, compile secondary dex files with the --debuggable flag too. Therefore, dex files loaded at runtime are compiled the same way as dex files compiled at install time on the classpath (excluding the boot image that is not compiled debuggable). Also adds debuggable key in the oat header and bump the oat version. Bug: 20944228 (cherry picked from commit 0de1133ba600f299b3d67938f650720d9f859eb2) Change-Id: If6b2236e7fe547cc421f57b573043748018d3ae0
* Print more info on mark sweep invalid ref crash.Hiroshi Yamauchi2015-05-151-6/+39
| | | | | | | | - Add extra info about the field holder. - Suspend threads when verifying roots. Bug: 20557050 Change-Id: Ia1f2269aaa3b1a81d0594e781e439a5decfb82f9
* Print field info on mark sweep invalid ref crash.Hiroshi Yamauchi2015-05-143-9/+25
| | | | | | | (cherry pick commit eb2baaf20d9059c0fc38141780ec05bea0486c40) Bug: 20557050 Change-Id: I3abb7a44e3b7ed3256653824fd1705aac5f7d72c
* Hold heap bitmap lock in Heap::GetObjectsAllocatedMathieu Chartier2015-05-121-2/+11
| | | | | | | | | | | Fixes a race condition where add and remove space could cause a crash when we iterated over the spaces. TODO: Add a spaces lock or something to guard against this. Bug: 21031927 Change-Id: I7f0d558316f8e9d9f22ffd182e8666355bf50d47
* ART: Merge entries with same name and protect in MemMap dump.Vladimir Marko2015-05-082-2/+2
| | | | | | | | | | | This should make the MemMap dump less chatty and allow the logger to keep more relevant output. Bug: 20873174 (cherry picked from commit 17a924abde2b0f1f37f6008b451a0a75190c71ff) Change-Id: I1748f57a1f149a5498b42ee246f13d2bf1e8c2f7
* Merge "Request full/partial GC type from VMRuntime.requestConcurrentGC()." ↵Hiroshi Yamauchi2015-05-053-14/+24
|\ | | | | | | into mnc-dev
| * Request full/partial GC type from VMRuntime.requestConcurrentGC().Hiroshi Yamauchi2015-05-013-14/+24
| | | | | | | | | | | | | | (cherry pick commit 0ae98992d348b5bf3fc85a52d81b0e5f221f20d6) Bug: 20554807 Change-Id: I572e846e9d0347b8b2692442e55f56c08b07d395
* | Add some more DISALLOW_COPY_AND_ASSIGNMathieu Chartier2015-05-0415-43/+37
|/ | | | | | | | May help prevent bugs maybe. (cherry picked from commit 3130cdf29eb203be0c38d1107a65d920ec39c106) Change-Id: Ie73d469dfcd078492ecb3aa28682b42707221202
* Print memory maps on GC crash.Hiroshi Yamauchi2015-05-011-0/+2
| | | | | | | | Bug: 20557050 (cherry picked from commit d38ec80b163af1639fbaae382a319c73be67c560) Change-Id: I0fc35bace77b11181f06199c121bc4e246d02100
* Change invalid root from LOG(ERROR) to LOG(INTERNAL_FATAL)Mathieu Chartier2015-05-011-3/+3
| | | | | | | | | INTERNAL_FATAL is more likely to remain in bug reports. (cherry picked from commit 175746ac9039e9b741d3521420dcaa9c59341738) Bug: 20736048 Change-Id: I518f079d8d1839e22b3595e807730edf36318f1d
* Prevent undefined behavior in RosAlloc.Dan Albert2015-04-281-3/+4
| | | | | | | In cases where remain == 0, the 32-bit value would be left shifted 32-bits, which is undefined behavior. Change-Id: I6277279341b168536f928ce87375c395a1aa865c
* Use the lock word bits for Baker-style read barrier.Hiroshi Yamauchi2015-04-233-12/+29
| | | | | | | | | | This enables the standard object header to be used with the Baker-style read barrier. Bug: 19355854 Bug: 12687968 Change-Id: Ie552b6e1dfe30e96cb1d0895bd0dff25f9d7d015
* Replace NULL with nullptrMathieu Chartier2015-04-2224-80/+80
| | | | | | | Also fixed some lines that were too long, and a few other minor details. Change-Id: I6efba5fb6e03eb5d0a300fddb2a75bf8e2f175cb
* Add sanity check for large object allocationMathieu Chartier2015-04-191-1/+12
| | | | | | | If there is a large object which ends up being covered by a space bitmap, it will not be marked correctly by the GC. Change-Id: Icdd0aaa207f476dd08effcee6cfbbb5de7ca1d17
* Merge "Remove transitive dependency on <cutils/atomic.h>."Yabin Cui2015-04-161-1/+2
|\
| * Remove transitive dependency on <cutils/atomic.h>.Yabin Cui2015-04-161-1/+2
| | | | | | | | | | Bug: 20262261 Change-Id: Ic6c2ed76e692fc09100b917e00ee9b73621ec8f0
* | Disable parallel GC by defaultMathieu Chartier2015-04-152-5/+3
|/ | | | | | | | Not using parallel GC seems to reduce avg pauses by ~0.1s on EvaluateAndApplyChanges. Avoiding creating the thread pool should help app launch slightly and reduce memory ussage. Change-Id: Iebec2a17701c76e4145b41d7c0b4f6dd17806efa
* Merge "Fix valgrind tests"Mathieu Chartier2015-04-143-20/+18
|\
| * Fix valgrind testsMathieu Chartier2015-04-143-20/+18
| | | | | | | | | | | | Delete large objects in space destructor. Also some cleanup. Change-Id: I4c4e90149841a156b7a3236201b37683e14890fb
* | getRuntimeStat() support (ART).Hiroshi Yamauchi2015-04-134-7/+174
|/ | | | | | | | | | | Export some runtime stats (currently GC stats) via VMDebug.getRuntimeStat(). Added several new GC stats such as blocking GC counts and GC count histograms. Bug: 19825248 Change-Id: I8ece9ed241dc3982dfd983d7159090ba82940dce
* ART: Clean up includes.Vladimir Marko2015-04-139-7/+27
| | | | | | | Reduce dependencies to improve incremental build times. Break up circular dependency involving class_linker-inl.h. Change-Id: I4be742c5c2b5cd9855beea86630fd68aab76b0db
* Move ArtField to nativeMathieu Chartier2015-04-1010-58/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add linear alloc. Moved ArtField to be native object. Changed image writer to put ArtFields after the mirror section. Savings: 2MB on low ram devices 4MB on normal devices Total PSS measurements before (normal N5, 95s after shell start): Image size: 7729152 bytes 23112 kB: .NonMoving 23212 kB: .NonMoving 22868 kB: .NonMoving 23072 kB: .NonMoving 22836 kB: .NonMoving 19618 kB: .Zygote 19850 kB: .Zygote 19623 kB: .Zygote 19924 kB: .Zygote 19612 kB: .Zygote Avg: 42745.4 kB After: Image size: 7462912 bytes 17440 kB: .NonMoving 16776 kB: .NonMoving 16804 kB: .NonMoving 17812 kB: .NonMoving 16820 kB: .NonMoving 18788 kB: .Zygote 18856 kB: .Zygote 19064 kB: .Zygote 18841 kB: .Zygote 18629 kB: .Zygote 3499 kB: .LinearAlloc 3408 kB: .LinearAlloc 3424 kB: .LinearAlloc 3600 kB: .LinearAlloc 3436 kB: .LinearAlloc Avg: 39439.4 kB No reflection performance changes. Bug: 19264997 Bug: 17643507 Change-Id: I10c73a37913332080aeb978c7c94713bdfe4fe1c
* Fix CC root visiting bugMathieu Chartier2015-04-071-4/+4
| | | | | | Also some cleanup. Change-Id: Ia3de8f2d409770be3619ec116e8b06ecd82338fe
* Merge "Add more logging for debugging possible deadlock"Mathieu Chartier2015-04-071-0/+3
|\
| * Add more logging for debugging possible deadlockMathieu Chartier2015-04-061-0/+3
| | | | | | | | Change-Id: I4b2db54504d3ed8c2c33a110191488cab1fcb2d9
* | ART: Enable more Clang warningsAndreas Gampe2015-04-064-3/+4
|/ | | | Change-Id: Ie6aba02f4223b1de02530e1515c63505f37e184c
* Refactor and improve GC root handlingMathieu Chartier2015-04-0610-118/+256
| | | | | | | | | | | | | | | | | | | | | | Changed GcRoot to use compressed references. Changed root visiting to use virtual functions instead of function pointers. Changed root visting interface to be an array of roots instead of a single root at a time. Added buffered root marking helper to avoid dispatch overhead. Root marking seems a bit faster on EvaluateAndApplyChanges due to batch marking. Pause times unaffected. Mips64 is untested but might work, maybe. Before: MarkConcurrentRoots: Sum: 67.678ms 99% C.I. 2us-664.999us Avg: 161.138us Max: 671us After: MarkConcurrentRoots: Sum: 54.806ms 99% C.I. 2us-499.986us Avg: 136.333us Max: 602us Bug: 19264997 Change-Id: I0a71ebb5928f205b9b3f7945b25db6489d5657ca
* Delete missed ClampGrowthLimit CHECKMathieu Chartier2015-04-031-1/+0
| | | | | Bug: 20043461 Change-Id: If4a0bb91c64571945756151be162f3626534781c
* Fix race with Heap::ClampGrowthLimit and GCMathieu Chartier2015-04-023-1/+7
| | | | | | | | | | | | | Aded logic for handling the temp bitmap if the GC is running and the live bitmap is clamped to the mark bitmap. This fixes the SIGABRT from ClampGrowthLimit if the GC clamped the bitmaps at this point. Also added locking of the heap_bitmap_lock_ so that added a lock so that the temp bitmap doesn't change from underneath us. Bug: 20043461 Change-Id: Ib427e40bcdf149de0408b4b53e6524f51463f0af
* Only GC the first time we call PreZygoteForkMathieu Chartier2015-03-311-2/+6
| | | | | | | PreZygoteFork is called for every app launch, it is overkill to GC each time since it takes 20-30ms and blocks app launch for that long. Change-Id: I647c8ccca767ceca67a006c1d80a739c7860f0d0
* Fixed layout for dex caches in boot image.Vladimir Marko2015-03-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Define a fixed layout for dex cache arrays (type, method, string and field arrays) for dex caches in the boot image. This gives those arrays fixed offsets from the boot image code and allows PC-relative addressing of their elements. Use the PC-relative load on arm64 for relevant instructions, i.e. invoke-static, invoke-direct, const-string, const-class, check-cast and instance-of. This reduces the arm64 boot.oat on Nexus 9 by 1.1MiB. This CL provides the infrastructure and shows on the arm64 the gains that we can achieve by having fixed dex cache arrays' layout. To fully use this for the boot images, we need to implement the PC-relative addressing for other architectures. To achieve similar gains for apps, we need to move the dex cache arrays to a .bss section of the oat file. These changes will be implemented in subsequent CLs. (Also remove some compiler_driver.h dependencies to reduce incremental build times.) Change-Id: Ib1859fa4452d01d983fd92ae22b611f45a85d69b
* Merge "Support relative encoded dex locations in oat files."Richard Uhler2015-03-251-1/+2
|\
| * Support relative encoded dex locations in oat files.Richard Uhler2015-03-241-1/+2
| | | | | | | | | | | | | | | | | | Now when opening an oat file, the caller can pass an absolute dex location used to resolve the absolute path for any relative encoded dex locations in the oat file. Bug: 19550105 Change-Id: I6e9559afe4d86ac12cf0b90176b5ea696a83d0e7
* | Remove some spammy loggingMathieu Chartier2015-03-201-1/+0
| | | | | | | | | | | | Did not provide useful info and or was redundant. Change-Id: I42da705debc43460cdd3fdf16e9e9ceb2c137001
* | Fix oat_file_assistant_test32 flaky failures with GSS collector.Hiroshi Yamauchi2015-03-171-3/+11
| | | | | | | | | | Bug: 19800031 Change-Id: I5146fa4e6a79bad94762102a50956c31251dcd2a
* | Add more info to who called SuspendAllMathieu Chartier2015-03-133-7/+7
| | | | | | | | | | | | Helps diagnose related jank. Change-Id: I38191cdda723c6f0355d0197c494a3dff2b6653c