71e46c1a2e1a8c2ef87b6137e8503dd12e18bb8d |
|
25-Jun-2015 |
Mathieu Chartier <mathieuc@google.com> |
Fix force copy We now correctly pass the returned pointer back onto the release functions. Bug: 22056708 Change-Id: I1a7300d3a4522a3c81b432ec742ae1c0bd00b51e (cherry picked from commit b735bd9c04aa291d0a1bdc2c0a094a1a75ad0596)
|
bad9c7b7f88689133cae59d9ccae231822a2020c |
|
14-Jun-2015 |
Mathieu Chartier <mathieuc@google.com> |
New experimental GC stress mode 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
|
a26cb57f46fd3f27a930d9d688fe8670c1f24754 |
|
23-Apr-2015 |
David Srbecky <dsrbecky@google.com> |
ART stack unwinding fixes for libunwind/gdb/lldb. 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
|
9a7fffb36bad0bf3e7bac21dd223d975bc9dde55 |
|
11-Jun-2015 |
Hiroshi Yamauchi <yamauchi@google.com> |
Reset GC performance stats at zygote fork. So GCs before a zygote fork won't be attributed to an app. Bug: 21491908 Change-Id: Ib37bc587e0f039ef8faeabe63dec19de49501863
|
3b532d744034b43ed329a3198f15846d80fec3f0 |
|
05-Jun-2015 |
Mathieu Chartier <mathieuc@google.com> |
Use runFinalizationWithTimeout for native allocations Prevents deadlocks by not waiting longer than 250ms for finalizers to complete. Bug: 21544853 Change-Id: I57b2f7ae8b74185922eb3c15ba0ab71a4d2348aa
|
7fabaa6ba1927d21a317c03499b705cbde4f6a47 |
|
07-Apr-2015 |
Richard Uhler <ruhler@google.com> |
Add atrace calls to runtime start and heap create Bug: 20727525 Change-Id: I91a74b793fb9eda8ed580244a6a5fd313ef2eb27
|
c991403cd8b869e4a38c11c6a58223b82b89a1b2 |
|
04-Jun-2015 |
Mathieu Chartier <mathieuc@google.com> |
Fix valgrind large_object_space_test Also some cleanup. Change-Id: I9c1a8093e6356f1b52e332009429b77fa5c1d448
|
8f23620d45399286564986d2541cda761b3fe0ac |
|
03-Jun-2015 |
Mathieu Chartier <mathieuc@google.com> |
Add a way to determine if a large object is a zygote object Also fix a slight memory leak in LargeObjectMapSpace. Bug: 20674158 Change-Id: I2416df484e5b84a8c5cc0b5664c8cb102dc235f6
|
3d21bdf8894e780d349c481e5c9e29fe1556051c |
|
22-Apr-2015 |
Mathieu Chartier <mathieuc@google.com> |
Move mirror::ArtMethod to native 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
|
41b175aba41c9365a1c53b8a1afbd17129c87c14 |
|
19-May-2015 |
Vladimir Marko <vmarko@google.com> |
ART: Clean up arm64 kNumberOfXRegisters usage. 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
|
a395c0a492079d86b312c9edc796d63001576954 |
|
12-May-2015 |
Mathieu Chartier <mathieuc@google.com> |
Hold heap bitmap lock in Heap::GetObjectsAllocated 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
|
dd5a4d0a9cdf75e8fffc3cc3a08c808bbd997b22 |
|
08-May-2015 |
Vladimir Marko <vmarko@google.com> |
ART: Merge entries with same name and protect in MemMap dump. 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
|
17a924abde2b0f1f37f6008b451a0a75190c71ff |
|
08-May-2015 |
Vladimir Marko <vmarko@google.com> |
ART: Merge entries with same name and protect in MemMap dump. This should make the MemMap dump less chatty and allow the logger to keep more relevant output. Bug: 20873174 Change-Id: I09058798faa8f79d154cee5008017b03700df8db
|
d45c84364db585f2e45a6264ae3116d004858677 |
|
02-May-2015 |
Hiroshi Yamauchi <yamauchi@google.com> |
Request full/partial GC type from VMRuntime.requestConcurrentGC(). (cherry pick commit 0ae98992d348b5bf3fc85a52d81b0e5f221f20d6) Bug: 20554807 Change-Id: I572e846e9d0347b8b2692442e55f56c08b07d395
|
0ae98992d348b5bf3fc85a52d81b0e5f221f20d6 |
|
01-May-2015 |
Hiroshi Yamauchi <yamauchi@google.com> |
Request full/partial GC type from VMRuntime.requestConcurrentGC(). Bug: 20554807 Change-Id: I1cd855507c3f4e191035dbc2c429e1b8b344d81b
|
2cebb24bfc3247d3e9be138a3350106737455918 |
|
22-Apr-2015 |
Mathieu Chartier <mathieuc@google.com> |
Replace NULL with nullptr Also fixed some lines that were too long, and a few other minor details. Change-Id: I6efba5fb6e03eb5d0a300fddb2a75bf8e2f175cb
|
a1c9f013c034fbddb9337cc5c7ecf0e5a8b77547 |
|
02-Apr-2015 |
Hiroshi Yamauchi <yamauchi@google.com> |
getRuntimeStat() support (ART). 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
|
c785344b87221f5e4e6473e5b762e4e61fe65dcf |
|
27-Mar-2015 |
Mathieu Chartier <mathieuc@google.com> |
Move ArtField to native 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
|
65b798ea10dd716c1bb3dda029f9bf255435af72 |
|
06-Apr-2015 |
Andreas Gampe <agampe@google.com> |
ART: Enable more Clang warnings Change-Id: Ie6aba02f4223b1de02530e1515c63505f37e184c
|
bb87e0f1a52de656bc77cb01cb887e51a0e5198b |
|
03-Apr-2015 |
Mathieu Chartier <mathieuc@google.com> |
Refactor and improve GC root handling 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
|
ddac42329314587f6f188bacf101b3cb15175b3c |
|
02-Apr-2015 |
Mathieu Chartier <mathieuc@google.com> |
Fix race with Heap::ClampGrowthLimit and GC 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
|
faed9950572632ffaac69e70c0b1ab90496c98f3 |
|
01-Apr-2015 |
Mathieu Chartier <mathieuc@google.com> |
Only GC the first time we call PreZygoteFork 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
|
cd8f6377821370cb471fb21ae095dfaa204e4410 |
|
21-Mar-2015 |
Mathieu Chartier <mathieuc@google.com> |
Remove some spammy logging Did not provide useful info and or was redundant. Change-Id: I42da705debc43460cdd3fdf16e9e9ceb2c137001
|
3dbf23412481c4da51f0ebe32bec5d300c36834b |
|
18-Mar-2015 |
Hiroshi Yamauchi <yamauchi@google.com> |
Fix oat_file_assistant_test32 flaky failures with GSS collector. Bug: 19800031 Change-Id: I5146fa4e6a79bad94762102a50956c31251dcd2a
|
bf9fc581e8870faddbd320a935f9a627da724c48 |
|
14-Mar-2015 |
Mathieu Chartier <mathieuc@google.com> |
Add more info to who called SuspendAll Helps diagnose related jank. Change-Id: I38191cdda723c6f0355d0197c494a3dff2b6653c
|
8711d1fadb62481cdcb10c829a54b36f6aa16f6f |
|
14-Mar-2015 |
Hiroshi Yamauchi <yamauchi@google.com> |
Fix valgrind heap_test. Copy the exact object size rather than the aligned size to avoid valgrind errors in the zygote compact collector. Change-Id: I260b8901f96fb4c0937a1a5237120b56f6858b7a
|
60e27165e13a8401ded88c492ab804419537b2c7 |
|
10-Mar-2015 |
Lin Zang <lin.zang@intel.com> |
ART: correct native bytes allocated in RegisterNativeAllocation Fix the issue that in RegisterNativeAllocation the new_native_bytes_allocated was not updated after Runfinalization, which may cause unnecessary GC. Change-Id: Icbbc0d1cbcd7b1b8e42576104de69c8ff3afa745 Signed-off-by: Lin Zang <lin.zang@intel.com>
|
d04495edc261bf7fbdb7c6a1c31c6dda08e990ed |
|
12-Mar-2015 |
Hiroshi Yamauchi <yamauchi@google.com> |
Fix CC collector boot. Avoid a DCHECK failure that the semi space collector isn't initialized at the pre-zygote fork time when the CC collector is used. Change-Id: If35707b241be05a341abb11ba51fbd0bc222d219
|
4460a84be92b5a94ecfb5c650aef4945ab849c93 |
|
09-Mar-2015 |
Hiroshi Yamauchi <yamauchi@google.com> |
Rosalloc thread local allocation path without a cas. Speedup on N4: MemAllocTest 3044 -> 2396 (~21% reduction) BinaryTrees 4101 -> 2929 (~26% reduction) Bug: 9986565 Change-Id: Ia1d1a37b9e001f903c3c056e8ec68fc8c623a78b
|
dfe3083054aa7be60adc24e3e58e0ae4773c41ff |
|
07-Mar-2015 |
Mathieu Chartier <mathieuc@google.com> |
Only allocate collectors if we may use them I believe most of the savings come from not allocating the concurrent copying 8MB MarkQueue. Before AOSP hh native PSS: 72653 kB: Native 72998 kB: Native 72882 kB: Native After AOSP hh native PSS: 64823 kB: Native 65986 kB: Native 64219 kB: Native Bug: 17643507 Change-Id: Ic5a8e753beca36142c1bf36be6311051f7c78e47
|
5c42c29b89286e5efa4a4613132b09051ce5945b |
|
25-Feb-2015 |
Vladimir Marko <vmarko@google.com> |
Add support for .bss section in oat files. Change-Id: I779b80b8139d9afdc28373f8c68edff5df7726ce
|
4858a935868162266ead90ef2f7802108711371d |
|
23-Jan-2015 |
Mathieu Chartier <mathieuc@google.com> |
Change card cache mod-union table to use bitmaps Previously used card sets, using bitmaps saves memory and slightly increases performance. Added mod union table test. Performance EvaluateAndApplyChanges (minimal changes): Before (card cache image mu table): UpdateAndMarkImageModUnionTable: Avg: 524.320us ImageModUnionClearCards: Avg: 54.580us Native PSS: ~67500kB After (card cache image mu table): UpdateAndMarkImageModUnionTable: Avg: 515.600us ImageModUnionClearCards: Avg: 53.780us Native PSS: ~66014kB Native PSS was higher before since the mod_union_table->SetCards() which happens pre zygote fork was allocating a large amount of std::nodes. Bug: 11859910 Change-Id: I956b7e51d5572feec1393ffa618b7b7d8c147b28
|
e4d99873eb1dbee956d76c1edef489103898b33f |
|
26-Feb-2015 |
Hiroshi Yamauchi <yamauchi@google.com> |
Add standard gc log for transition collections. Factor out the gc log logic into a function. Note we still don't log in background as before but do for things like OOME compactions in foreground. Change-Id: Ifd35a796cf26aba2fba83bf07e72902357d91f8b
|
e5f13e57ff8fa36342beb33830b3ec5942a61cca |
|
24-Feb-2015 |
Mathieu Chartier <mathieuc@google.com> |
Revert "Revert "Add JIT"" Added missing EntryPointToCodePointer. This reverts commit a5ca888d715cd0c6c421313211caa1928be3e399. Change-Id: Ia74df0ef3a7babbdcb0466fd24da28e304e3f5af
|
a5ca888d715cd0c6c421313211caa1928be3e399 |
|
24-Feb-2015 |
Nicolas Geoffray <ngeoffray@google.com> |
Revert "Add JIT" Sorry, run-test crashes on target: 0-05 12:15:51.633 I/DEBUG (27995): Abort message: 'art/runtime/mirror/art_method.cc:349] Check failed: PcIsWithinQuickCode(reinterpret_cast<uintptr_t>(code), pc) java.lang.Throwable java.lang.Throwable.fillInStackTrace() pc=71e3366b code=0x71e3362d size=ad000000' 10-05 12:15:51.633 I/DEBUG (27995): r0 00000000 r1 0000542b r2 00000006 r3 00000000 10-05 12:15:51.633 I/DEBUG (27995): r4 00000006 r5 b6f9addc r6 00000002 r7 0000010c 10-05 12:15:51.633 I/DEBUG (27995): r8 b63fe1e8 r9 be8e1418 sl b6427400 fp b63fcce0 10-05 12:15:51.633 I/DEBUG (27995): ip 0000542b sp be8e1358 lr b6e9a27b pc b6e9c280 cpsr 40070010 10-05 12:15:51.633 I/DEBUG (27995): Bug: 17950037 This reverts commit 2535abe7d1fcdd0e6aca782b1f1932a703ed50a4. Change-Id: I6f88849bc6f2befed0c0aaa0b7b2a08c967a83c3
|
2535abe7d1fcdd0e6aca782b1f1932a703ed50a4 |
|
17-Feb-2015 |
Mathieu Chartier <mathieuc@google.com> |
Add JIT Currently disabled by default unless -Xjit is passed in. The proposed JIT is a method JIT which works by utilizing interpreter instrumentation to request compilation of hot methods async during runtime. JIT options: -Xjit / -Xnojit -Xjitcodecachesize:N -Xjitthreshold:integervalue The JIT has a shared copy of a compiler driver which is accessed by worker threads to compile individual methods. Added JIT code cache and data cache, currently sized at 2 MB capacity by default. Most apps will only fill a small fraction of this cache however. Added support to the compiler for compiling interpreter quickened byte codes. Added test target ART_TEST_JIT=TRUE and --jit for run-test. TODO: Clean up code cache. Delete compiled methods after they are added to code cache. Add more optimizations related to runtime checks e.g. direct pointers for invokes. Add method recompilation. Move instrumentation to DexFile to improve performance and reduce memory usage. Bug: 17950037 Change-Id: Ifa5b2684a2d5059ec5a5210733900aafa3c51bca
|
ac195160c299f1c7a87144da7dccb9411df3c1fd |
|
20-Feb-2015 |
Mathieu Chartier <mathieuc@google.com> |
Revert "Do GC for alloc for unstarted runtimes" Bug: 19451379 This reverts commit c0a7e2bb1609da40ec67cb7e00c918637c610897. Change-Id: Ib079e5ce1647fd44239f7f2f658b2c50d619fece
|
c0a7e2bb1609da40ec67cb7e00c918637c610897 |
|
16-Dec-2014 |
Mathieu Chartier <mathieuc@google.com> |
Do GC for alloc for unstarted runtimes Currently, concurrent GC requests are ignored for unstarted runtimes. The new logic is to do a GC for alloc in RequestConcurrentGC if the runtime is not started. This reduces the java heap size in dex2oat. Change-Id: I8d4364a4e3537013b27390bb22a6f64aab58c924
|
aaebaa0121be3b9d9f13630585304482cbcaeb4b |
|
26-Jan-2015 |
Igor Murashkin <iam@google.com> |
art: Refactor RuntimeOptions/ParsedOptions Refactor the RuntimeOptions to be a type-safe map (VariantMap, see runtime_options.h) and the ParsedOptions to delegate the parsing to CmdlineParser (see cmdline/cmdline_parser.h). This is the start of a command line parsing refactor, and may include more in the future (dex2oat, patchoat, etc). For more details of the command line parsing generator usage see cmdline/README.md Change-Id: Ic67c6bca5e1f33bf2ec60e2e3ff8c366bab91563
|
dd9943d4466b052ef6c5ee5b32187adb48cbce74 |
|
02-Feb-2015 |
Lei Li <lei.l.li@intel.com> |
ART: checkpoint mechanism optimization GC thread and trim thread are both using checkpoint mechanism. GC thread will request java threads to mark their thread roots by themselves. Trim thread will request java threads to trim their jni local reference tables by themselves. The checkpint mechanism semantics is that the runnable java threads will run checkpoint function itself at safepoint, and finally the java threads and gc thread or trim thread is synchronized via barrier. If the java threads are not runnable, gc thread or trim thread will suspend them and then run their checkpoint functions one by one on behalf of them. If all the java threads are not runnable, then gc thread or trim thread will do all the work itself. In this case, there is no need synchronization. This will save unnecessary synchronization and thread state transitions. Change-Id: If55940946cb3f8b1af42c7237c334f09c8ec7a9f
|
4add3b4fa38ec42bb3c71d01cf70bce8e9a9fb4e |
|
15-Jan-2015 |
Lei Li <lei.l.li@intel.com> |
ART: clear dirty cards of alloc space for MS/CMS partial and full GCs For MS/CMS partial and full GCs, we could clear the dirty cards of alloc space when we process cards as we care about the dirty cards after GC starts. Change-Id: I1f9b32b20d75979387bc5d26b0cf9a256dcf20b6 Signed-off-by: Lei Li <lei.l.li@intel.com>
|
cb535da36915f9d10bec3880b46f1de1f7a69f22 |
|
23-Jan-2015 |
Mathieu Chartier <mathieuc@google.com> |
Change AtomicStack to use StackReference Previously used Object*, using StackReference saves memory on 64 bit devices. Bug: 12935052 Bug: 17643507 Change-Id: I035878690054eeeb24d655a900b8f26c837703ff
|
2cd334ae2d4287216523882f0d298cf3901b7ab1 |
|
09-Jan-2015 |
Hiroshi Yamauchi <yamauchi@google.com> |
More of the concurrent copying collector. Bug: 12687968 Change-Id: I62f70274d47df6d6cab714df95c518b750ce3105
|
727b294b4091cf3cc2f8137cd654552f477fe46a |
|
15-Jan-2015 |
Lei Li <lei.l.li@intel.com> |
ART: clear dirty cards of alloc space in pause phase Clear the dirty cards of alloc spaces when scanning them in pause phase, the dirty cards of image or zygote space will not be cleared in order to track the references to the other spaces. Change-Id: I519f071d954a589aa33dbce0cdba405f2d2cef71 Signed-off-by: Lei Li <lei.l.li@intel.com>
|
0c8c303c20cdaaf54d26e45cc17dc5afb820d8ef |
|
17-Jan-2015 |
Hiroshi Yamauchi <yamauchi@google.com> |
Clean up the locks around Heap::VisitObjects(). This is so that we could support suspending all threads when visiting objects in the presence of a concurrent, moving collector. Bug: 12687968 Change-Id: Icc8e60630465afde948ebc6ea91d4ebaff5d7837
|
e34fa1df67fbe0173b4ea9abddcc3ae3d0537037 |
|
14-Jan-2015 |
Mathieu Chartier <mathieuc@google.com> |
Print more info in MarkSweep::VerifyRoot Refactored old root callback to use a new class called RootInfo. RootInfo contains all the relevant info related to the root associated with the callback. The MarkSweep::VerifyRoot function now uses this info to print the StackVisitor's described location if the GC root is of the type kRootJavaFrame. Some other cleanup. Example output: E/art (12167): Tried to mark 0x123 not contained by any spaces E/art (12167): Attempting see if it's a bad root E/art (12167): Found invalid root: 0x123 with type RootJavaFrame E/art (12167): Location=Visiting method 'void java.lang.Runtime.gc()' at dex PC 0xffffffff (native PC 0x0) vreg=0 (cherry picked from commit 12f7423a2bb4bfab76700d84eb6d4338d211983a) Bug: 18588862 Change-Id: Ic5a2781f704e931265ffb3621c2eab4b2e25f60f
|
12f7423a2bb4bfab76700d84eb6d4338d211983a |
|
14-Jan-2015 |
Mathieu Chartier <mathieuc@google.com> |
Print more info in MarkSweep::VerifyRoot Refactored old root callback to use a new class called RootInfo. RootInfo contains all the relevant info related to the root associated with the callback. The MarkSweep::VerifyRoot function now uses this info to print the StackVisitor's described location if the GC root is of the type kRootJavaFrame. Some other cleanup. Example output: E/art (12167): Tried to mark 0x123 not contained by any spaces E/art (12167): Attempting see if it's a bad root E/art (12167): Found invalid root: 0x123 with type RootJavaFrame E/art (12167): Location=Visiting method 'void java.lang.Runtime.gc()' at dex PC 0xffffffff (native PC 0x0) vreg=0 Bug: 18588862 Change-Id: Ic5a2781f704e931265ffb3621c2eab4b2e25f60f
|
a233e03473cd9f0a582447f71946122140a2472c |
|
10-Jan-2015 |
Hiroshi Yamauchi <yamauchi@google.com> |
[WIP] Fix a rosalloc verification crash. Bug: 18960494 Change-Id: Ia7a11f06b3fc8207f6304ae881539251d6b1de24
|
68d1bfc0bb5a7be79354f6551dae6cd600c20e76 |
|
08-Jan-2015 |
Mathieu Chartier <mathieuc@google.com> |
Add clamp growth limit Clamp growth limit shrinks the space memmaps to the current growth limit. This reduces virtual memory usage for apps with small heaps. Bug: 18387825 Bug: 17131630 (cherry picked from commit 379d09fe3c3feb7c2a2fb5a3623689b5ace7e79b) Change-Id: I4f8e507fde1c8e10373615254aa0f1bf1b48a7ea
|
379d09fe3c3feb7c2a2fb5a3623689b5ace7e79b |
|
08-Jan-2015 |
Mathieu Chartier <mathieuc@google.com> |
Add clamp growth limit Clamp growth limit shrinks the space memmaps to the current growth limit. This reduces virtual memory usage for apps with small heaps. Bug: 18387825 Bug: 17131630 Change-Id: I4a8fdc335d2c40492e991708adabcc46299efb7d
|
50c138f7f89ed03d49aa4bdde7351c26b3403e90 |
|
08-Jan-2015 |
Mathieu Chartier <mathieuc@google.com> |
Fix signal test to work with gcstress We now avoid running GC if we are handling a stack overflow, this helps prevent running past the end of the stack overflow reserved bytes. Added logic in ThrowStackOverflowError to use a stack overflow exception without a stack trace if we fail to allocate the stack trace. Bug: 16406852 Change-Id: Ib34e235cd0af6d7c4c93c9705fa822f2b9b23b38
|
a5eae69589ff562ad66c57665882cd16f237321c |
|
18-Dec-2014 |
Mathieu Chartier <mathieuc@google.com> |
Add heap task processor The heap task processor processes async tasks which may be delayed. The motivation for this change is preventing deadlocks which can occur when the daemon threads get suspended by GetThreadStack. Other improvements, reduces daemon thread count by one. Cleaner pending transition VS heap trimming logic. Bug: 18739541 Change-Id: Idab52b2d9661a6385cada74b93ff297ddc55fc78
|
e2c2f6e61df0bfa1516bfc8943e78ea610d4d878 |
|
17-Dec-2014 |
Mathieu Chartier <mathieuc@google.com> |
Fix concurrent GC ergonomics Fixed a race with the gc_request_pending_ boolean which would cause two concurrent GCs to start in a row in most cases. This broke sticky CMS ergonomics since the second GC was a sticky CMS which started way too early resulting in low throughput. Since the throughput was low, it switch to partial / full for the next iteration. The race happened as follows, allocating thread would request concurrent GC which woke up the daemon thread. The daemon thread cleared the gc_request_pending_ boolean, but before we set the concurrent_start_bytes_ to max in to prevent more request, the allocating thread would call RequestConcurrentGC again. This caused the next WaitForConcurrentGCRequest to return right away and a concurrent GC to occur earlier than necessary. Changed the allocation rate ergonomics to use allocation rate during the GC instead of allocation rate inbetween GCs, this is better since the allocation rate may become slower if the GC steals mutator time, resulting in concurrent GCs starting a bit earlier than they need to. Fixed a bug in GrowForUtilization where we didn't use the adjusted max_free when we shrank down the heap, this caused the sticky CMS to occasionally shrink the heap more than necessary. EvaluateAndApplyChanges: Before: ~12.6s GC time After: ~7.75s GC time Change-Id: I354bc825b3c44ccfbfe867af0d437b17fe1fe022
|
70a596d61f8cf5b6447326c46c3386e0fbd5bfb5 |
|
17-Dec-2014 |
Mathieu Chartier <mathieuc@google.com> |
Add thread suspend histogram Helps measure time to suspend. Example output (maps after a few seconds): suspend all histogram: Sum: 2.806ms 99% C.I. 2us-1090.560us Avg: 43.843us Max: 1126us Change-Id: I7bd9dd3b401fb3e3059e8718556d60910e541611
|
c85cdeb22b6d38b90904241c284f389043822073 |
|
17-Dec-2014 |
Mathieu Chartier <mathieuc@google.com> |
Delete gc request lock Fixes valgrind tests. Change-Id: I763e5709fffb002b14615ed5d08236970643e520
|
079101a17575114622f6e1d5be5c9ba643630e9a |
|
15-Dec-2014 |
Mathieu Chartier <mathieuc@google.com> |
Move GC daemon locking logic into heap Fixes deadlock caused by acquirng the mutator lock while synchronizing on the daemon thread. Bug: 18739541 Change-Id: I925b8f0f3b58178da6eff17b9c073f655c39597b
|
956af0f0cb05422e38c1d22cbef309d16b8a1a12 |
|
11-Dec-2014 |
Elliott Hughes <enh@google.com> |
Remove portable. Change-Id: I3bf3250fa866fd2265f1b115d52fa5dedc48a7fc
|
95a505c787fe4673c091e5cd4bd2905d9f17ae36 |
|
11-Dec-2014 |
Mathieu Chartier <mathieuc@google.com> |
Increase default allocation stack size Prevents some GC for alloc which can occur if the allocation stack overflows. Bug: 18707404 (cherry picked from commit 4911153db37264de407b2a08c2e4c9bb6aef3545) Change-Id: I4748485dd495526ab1a313f366d93dbb3ee8112b
|
4911153db37264de407b2a08c2e4c9bb6aef3545 |
|
11-Dec-2014 |
Mathieu Chartier <mathieuc@google.com> |
Increase default allocation stack size Prevents some GC for alloc which can occur if the allocation stack overflows. Bug: 18707404 Change-Id: I00e8e518aa5105b69c70603a8395c81617b87d14
|
0310da5361f41bc7f58eb102a5b232faa394183a |
|
01-Dec-2014 |
Mathieu Chartier <mathieuc@google.com> |
Fix growth limit / footprint limit problems We now properly clear the growth limit of all the spaces when ClearGrowthLimit is called. Previously we didn't clear the growth limit of the background space. This wasn't caught by heap test since it only manifested itself when we had a zygote space. Bug: 18504942 (cherry picked from commit d59c170057dcc213a858652abc71eec710898a41) Change-Id: I6e4394b9c9f7f22aabc5f5955adb8dd4511c2617
|
d59c170057dcc213a858652abc71eec710898a41 |
|
01-Dec-2014 |
Mathieu Chartier <mathieuc@google.com> |
Fix growth limit / footprint limit problems We now properly clear the growth limit of all the spaces when ClearGrowthLimit is called. Previously we didn't clear the growth limit of the background space. This wasn't caught by heap test since it only manifested itself when we had a zygote space. Bug: 18504942 Change-Id: Ibb3d76cba54a45ef755d7e2ced8c2e16cd2996b0
|
3abf4d694acde8f7f3efaa11dcd8ea74c7281c66 |
|
27-Nov-2014 |
Mathieu Chartier <mathieuc@google.com> |
Revert "Trim reference tables when we trim the heap" This reverts commit 84dc99d2fa67e5dff018685661cb2bff62132989. Change-Id: I48c2563c9b4579d6f4dadac6b8dcae8428993fab
|
abf9edc6915ae92e94ecb422a12190fa8e22afc4 |
|
27-Nov-2014 |
Mathieu Chartier <mathieuc@google.com> |
Revert "Add missing thread state change to kWaitingForCheckPointsToRun" This reverts commit 20e11a7956eaebf97d7ed44bbca1c42948b3a580. Change-Id: Ifde51cba3f02c64f2dac5bd95ddaf474f15e4f86
|
6785702b58ac97c07550a67734b9ef88e94d7d99 |
|
27-Nov-2014 |
Mathieu Chartier <mathieuc@google.com> |
Revert "Revert "Add missing thread state change to kWaitingForCheckPointsToRun"" This reverts commit 12e29285346a68e46444a5a7b87608475c1147ac. Change-Id: I24e42309f19f781f3159cb715e8a64d6aea4b464
|
12e29285346a68e46444a5a7b87608475c1147ac |
|
27-Nov-2014 |
Mathieu Chartier <mathieuc@google.com> |
Revert "Add missing thread state change to kWaitingForCheckPointsToRun" This reverts commit 20e11a7956eaebf97d7ed44bbca1c42948b3a580. Change-Id: Ifde51cba3f02c64f2dac5bd95ddaf474f15e4f86
|
91c2f0cde2a009bd52aa1c3d1dee705cc02c932f |
|
26-Nov-2014 |
Mathieu Chartier <mathieuc@google.com> |
Trim reference tables when we trim the heap Before: System server: virtual shared shared private private size RSS PSS clean dirty clean dirty # object 2200 300 229 0 80 0 220 77 /dev/ashmem/dalvik-indirect ref table (deleted) Location: 1896 128 102 0 28 0 100 39 /dev/ashmem/dalvik-indirect ref table (deleted) After: virtual shared shared private private size RSS PSS clean dirty clean dirty # object System server: 2216 64 64 0 0 0 64 79 /dev/ashmem/dalvik-indirect ref table (deleted) Location: 2120 48 48 0 0 0 48 67 /dev/ashmem/dalvik-indirect ref table (deleted) No pause time regression measured in memalloc test. (cherry picked from commit 84dc99d2fa67e5dff018685661cb2bff62132989) Change-Id: I80d9bd3b98e888fa8f77d03df69f8479ed209986
|
20e11a7956eaebf97d7ed44bbca1c42948b3a580 |
|
27-Nov-2014 |
Mathieu Chartier <mathieuc@google.com> |
Add missing thread state change to kWaitingForCheckPointsToRun Fixes tests Change-Id: I4907d83ee1e9bcd2f6a823e402950d8051d4556a
|
84dc99d2fa67e5dff018685661cb2bff62132989 |
|
26-Nov-2014 |
Mathieu Chartier <mathieuc@google.com> |
Trim reference tables when we trim the heap Before: System server: virtual shared shared private private size RSS PSS clean dirty clean dirty # object 2200 300 229 0 80 0 220 77 /dev/ashmem/dalvik-indirect ref table (deleted) Location: 1896 128 102 0 28 0 100 39 /dev/ashmem/dalvik-indirect ref table (deleted) After: virtual shared shared private private size RSS PSS clean dirty clean dirty # object System server: 2216 64 64 0 0 0 64 79 /dev/ashmem/dalvik-indirect ref table (deleted) Location: 2120 48 48 0 0 0 48 67 /dev/ashmem/dalvik-indirect ref table (deleted) No pause time regression measured in memalloc test. Bug: 17643507 Change-Id: I32d3e64cdcf8dd2f7aea509c81631597bbb9b392
|
7247af507f8e2218e73379ded5b2c4bbdd2a56c7 |
|
19-Nov-2014 |
Mathieu Chartier <mathieuc@google.com> |
Fix zygote space and non moving space map names Space names: "non moving space" -> "zygote space" "alloc space" -> "non moving space" Bug: 18447855 Change-Id: Ia937b6d046ccf7f66bf1f6bbb9f17a5e0d00c016 (cherry picked from commit c5d085c955244be1743c33227384e5b62076b8bd)
|
c5d085c955244be1743c33227384e5b62076b8bd |
|
19-Nov-2014 |
Mathieu Chartier <mathieuc@google.com> |
Fix zygote space and non moving space map names Space names: "non moving space" -> "zygote space" "alloc space" -> "non moving space" Bug: 18447855 Change-Id: Ia937b6d046ccf7f66bf1f6bbb9f17a5e0d00c016
|
20ed5af7a623a2d095082f8d6f53151c46fb8842 |
|
18-Nov-2014 |
Hiroshi Yamauchi <yamauchi@google.com> |
Enable the hspace compaction on OOM by default. (cherrypick commit d3f228062a1d71ce6ace2f31ecf369ae247633c2) Bug: 18377775 Change-Id: I4a0998c7f35b6418004e92bc07926abc9b74962a
|
d3f228062a1d71ce6ace2f31ecf369ae247633c2 |
|
15-Nov-2014 |
Hiroshi Yamauchi <yamauchi@google.com> |
Enable the hspace compaction on OOM by default. Bug: 18377775 Change-Id: I714367813e0f6d7cb854ace7f40dad0715f99e00
|
c2e20629c7dfdb0f679fa30c14b41fe68588697f |
|
03-Nov-2014 |
Mathieu Chartier <mathieuc@google.com> |
Add hash set More memory efficient than libcxx since we do not box the values. Change intern table to use new hash set. Clean up intern table by removing const casts and deleting unnecessary code. Changed the class linker to use a hash set, also added a pre-zygote class table. 5 samples of: adb shell stop && adb shell start && sleep 60 && adb shell dumpsys meminfo Before: 165929 kB: Native 175859 kB: Native 168434 kB: Native 166559 kB: Native 169958 kB: Native After: 160972 kB: Native 159439 kB: Native 157204 kB: Native 165093 kB: Native 163039 kB: Native TODO: Add HashTable which is implemented by using a HashSet. TODO: Use for DexFile::find_class_def_misses_. TODO: Investigate using mem maps instead of native heap. Bug: 17808975 Change-Id: I93e376cf6eb9628cf52f4aefdadb6157acfb799a (cherry picked from commit e05d1d5fd86867afc7513b1c546375dba11eee50)
|
e05d1d5fd86867afc7513b1c546375dba11eee50 |
|
03-Nov-2014 |
Mathieu Chartier <mathieuc@google.com> |
Add hash set More memory efficient than libcxx since we do not box the values. Change intern table to use new hash set. Clean up intern table by removing const casts and deleting unnecessary code. Changed the class linker to use a hash set, also added a pre-zygote class table. 5 samples of: adb shell stop && adb shell start && sleep 60 && adb shell dumpsys meminfo Before: 165929 kB: Native 175859 kB: Native 168434 kB: Native 166559 kB: Native 169958 kB: Native After: 160972 kB: Native 159439 kB: Native 157204 kB: Native 165093 kB: Native 163039 kB: Native TODO: Add HashTable which is implemented by using a HashSet. TODO: Use for DexFile::find_class_def_misses_. TODO: Investigate using mem maps instead of native heap. Bug: 17808975 Change-Id: I93e376cf6eb9628cf52f4aefdadb6157acfb799a
|
277ccbd200ea43590dfc06a93ae184a765327ad0 |
|
04-Nov-2014 |
Andreas Gampe <agampe@google.com> |
ART: More warnings Enable -Wno-conversion-null, -Wredundant-decls and -Wshadow in general, and -Wunused-but-set-parameter for GCC builds. Change-Id: I81bbdd762213444673c65d85edae594a523836e5
|
6a3c1fcb4ba42ad4d5d142c17a3712a6ddd3866f |
|
31-Oct-2014 |
Ian Rogers <irogers@google.com> |
Remove -Wno-unused-parameter and -Wno-sign-promo from base cflags. Fix associated errors about unused paramenters and implict sign conversions. For sign conversion this was largely in the area of enums, so add ostream operators for the effected enums and fix tools/generate-operator-out.py. Tidy arena allocation code and arena allocated data types, rather than fixing new and delete operators. Remove dead code. Change-Id: I5b433e722d2f75baacfacae4d32aef4a828bfe1b
|
eb175f70ef352ce0b9bcafdf06c5ac22b0ff626a |
|
31-Oct-2014 |
Mathieu Chartier <mathieuc@google.com> |
Add image strings to intern table When we create the runtime, we now add the image strings to the intern table if we are the zygote. This caused some memory bloat, so I added an extra unordered set to the intern table. There is now two unordered sets (hash talbe). One for pre-zygote interns and one for post-zygote interns. This helps since the pre-zygote hash table doesn't get dirtied. Even with adding the image strings, we get total memory savings of around 5-7 MB native PSS after device boot. FB launch Before: 2.20% art::DexFile::FindStringId(char const*) const TotalTime: 2069 TotalTime: 1985 TotalTime: 2088 TotalTime: 2003 TotalTime: 2034 TotalTime: 2049 After boot native PSS: 175585 kB: Native After: 0.27% art::DexFile::FindStringId(char const*) const TotalTime: 1682 TotalTime: 1756 TotalTime: 1825 TotalTime: 1751 TotalTime: 1666 TotalTime: 1813 After boot native PSS: 167089 kB: Native Bug: 18054905 Bug: 16828525 Bug: 17808975 (cherry picked from commit b6e292bf7eac9d73c6b79b1e9b7b87beb02436c9) Change-Id: Ie367f3222f8c4db409ec49c3845276908b51e9c9
|
b6e292bf7eac9d73c6b79b1e9b7b87beb02436c9 |
|
31-Oct-2014 |
Mathieu Chartier <mathieuc@google.com> |
Add image strings to intern table When we create the runtime, we now add the image strings to the intern table if we are the zygote. This caused some memory bloat, so I added an extra unordered set to the intern table. There is now two unordered sets (hash talbe). One for pre-zygote interns and one for post-zygote interns. This helps since the pre-zygote hash table doesn't get dirtied. Even with adding the image strings, we get total memory savings of around 5-7 MB native PSS after device boot. FB launch Before: 2.20% art::DexFile::FindStringId(char const*) const TotalTime: 2069 TotalTime: 1985 TotalTime: 2088 TotalTime: 2003 TotalTime: 2034 TotalTime: 2049 After boot native PSS: 175585 kB: Native After: 0.27% art::DexFile::FindStringId(char const*) const TotalTime: 1682 TotalTime: 1756 TotalTime: 1825 TotalTime: 1751 TotalTime: 1666 TotalTime: 1813 After boot native PSS: 167089 kB: Native Bug: 18054905 Bug: 16828525 Bug: 17808975 Change-Id: Ie367f3222f8c4db409ec49c3845276908b51e9c9
|
872dd8208f00c667af8d9e0fd07fdd0ada56d437 |
|
30-Oct-2014 |
Ian Rogers <irogers@google.com> |
Tidy and reduce ART library dependencies on the host. Move to shared rather than static libraries. Avoids capture of all static libraries library dependencies. Change-Id: I2be96e92dad4ed1842d76b044745f2a2e15372eb
|
2c4257be8191c5eefde744e8965fcefc80a0a97d |
|
24-Oct-2014 |
Ian Rogers <irogers@google.com> |
Tidy logging code not using UNIMPLEMENTED. Change-Id: I7a79c1671a6ff8b2040887133b3e0925ef9a3cfe
|
c63a505ae9992cc6ad154179734f078594c72d01 |
|
23-Oct-2014 |
Mathieu Chartier <mathieuc@google.com> |
Fix concurrent start bytes race Previously, we set concurrent start bytes to max int when we requested a concurrent GC, but there was a race if another thread was doing another GC and had already completed GrowForUtilization but had not yet finished the GC. This meant that the thread doing the GC would update the concurrent start bytes properly, but the allocating thread would re-update it to max int. Then when the concurrent GC thread woke up, it would call WaitForGcToComplete and see that there was a collector running and avoid doing the concurrent GC, leaving the concurrent start bytes set to max int. This meant that there would be no more concurrent GC until either the next explicit GC or the next GC for alloc. The fix is to only set concurrent start bytes to max int inside of the CollectGarbageInternal code such that there isn't any way for two threads to race. Bug: 17942071 Change-Id: I2a4b067d99ae0aeebcc32fa4970024dcdff2ddc3 (cherry picked from commit 0133ec454d8dd3fa5ffe35649b5704aa18f15a49)
|
08cef22f4675862fd4bcf486a3f58d70d4ba5234 |
|
23-Oct-2014 |
Mathieu Chartier <mathieuc@google.com> |
Fix concurrent start bytes race Previously, we set concurrent start bytes to max int when we requested a concurrent GC, but there was a race if another thread was doing another GC and had already completed GrowForUtilization but had not yet finished the GC. This meant that the thread doing the GC would update the concurrent start bytes properly, but the allocating thread would re-update it to max int. Then when the concurrent GC thread woke up, it would call WaitForGcToComplete and see that there was a collector running and avoid doing the concurrent GC, leaving the concurrent start bytes set to max int. This meant that there would be no more concurrent GC until either the next explicit GC or the next GC for alloc. The fix is to only set concurrent start bytes to max int inside of the CollectGarbageInternal code such that there isn't any way for two threads to race. Bug: 17942071 (cherry picked from commit 0133ec454d8dd3fa5ffe35649b5704aa18f15a49) Change-Id: Ibc23dd2f937a2b5fda51ed064634c034dbb6e668
|
ef32b8f169d7440d24ca4f99adb87e64d424e287 |
|
23-Oct-2014 |
Kyungmin Lee <snailee@gmail.com> |
Use the passed-in 'name' param to create a MemMap. Change-Id: I15c33b23751f4c32cb40c9514b602845feb47f9f Signed-off-by: Kyungmin Lee <snailee@gmail.com>
|
0133ec454d8dd3fa5ffe35649b5704aa18f15a49 |
|
23-Oct-2014 |
Mathieu Chartier <mathieuc@google.com> |
Fix concurrent start bytes race Previously, we set concurrent start bytes to max int when we requested a concurrent GC, but there was a race if another thread was doing another GC and had already completed GrowForUtilization but had not yet finished the GC. This meant that the thread doing the GC would update the concurrent start bytes properly, but the allocating thread would re-update it to max int. Then when the concurrent GC thread woke up, it would call WaitForGcToComplete and see that there was a collector running and avoid doing the concurrent GC, leaving the concurrent start bytes set to max int. This meant that there would be no more concurrent GC until either the next explicit GC or the next GC for alloc. The fix is to only set concurrent start bytes to max int inside of the CollectGarbageInternal code such that there isn't any way for two threads to race. Bug: 17942071 Change-Id: I2a4b067d99ae0aeebcc32fa4970024dcdff2ddc3
|
c7dd295a4e0cc1d15c0c96088e55a85389bade74 |
|
22-Oct-2014 |
Ian Rogers <irogers@google.com> |
Tidy up logging. Move gVerboseMethods to CompilerOptions. Now "--verbose-methods=" option to dex2oat rather than runtime argument "-verbose-methods:". Move ToStr and Dumpable out of logging.h, move LogMessageData into logging.cc except for a forward declaration. Remove ConstDumpable as Dump methods are all const (and make this so if not currently true). Make LogSeverity an enum and improve compile time assertions and type checking. Remove log_severity.h that's only used in logging.h. With system headers gone from logging.h, go add to .cc files missing system header includes. Also, make operator new in ValueObject private for compile time instantiation checking. Change-Id: I3228f614500ccc9b14b49c72b9821c8b0db3d641
|
13735955f39b3b304c37d2b2840663c131262c18 |
|
08-Oct-2014 |
Ian Rogers <irogers@google.com> |
stdint types all the way! Change-Id: I4e4ef3a2002fc59ebd9097087f150eaf3f2a7e08
|
9ef78b59da51080882e47505896b420977fd79ae |
|
26-Sep-2014 |
Mathieu Chartier <mathieuc@google.com> |
Fix broken runtime SetStatsEnabled logic Previously, Runtime::SetStatsEnabled wouldn't take stats_enabled_ into account when deciding whether or not to increment / decrement teh stats enabled counter. This resulted in counter underflows and other errors which caused some CTS tests to fail. Also added some locking to prevent race conditions. Bug: 17360878 (cherry picked from commit a98ffd745bbecb2e84a492194950c0b94966546b) Change-Id: I21d241a58d35bd6a607aa2305c6da81720bd0886
|
268ea6c707ea5db008ff7b5e5a49e8aa952b5127 |
|
26-Sep-2014 |
Mathieu Chartier <mathieuc@google.com> |
Change heap base address Moved to 300 MB to allow room for other people who wish to use the low 1 GB. Bug: 17671634 (cherry picked from commit 23fb122b57c52ab1db98708a4e15765b46b26405) Change-Id: Icb2784fc92cb5c46edb6e3a9de2d8383e012a07c
|
23fb122b57c52ab1db98708a4e15765b46b26405 |
|
26-Sep-2014 |
Mathieu Chartier <mathieuc@google.com> |
Change heap base address Moved to 300 MB to allow room for other people who wish to use the low 1 GB. Bug: 17671634 Change-Id: Ia434a106f4d8f6050edd79f90b4651b1aa32e823
|
a98ffd745bbecb2e84a492194950c0b94966546b |
|
26-Sep-2014 |
Mathieu Chartier <mathieuc@google.com> |
Fix broken runtime SetStatsEnabled logic Previously, Runtime::SetStatsEnabled wouldn't take stats_enabled_ into account when deciding whether or not to increment / decrement teh stats enabled counter. This resulted in counter underflows and other errors which caused some CTS tests to fail. Also added some locking to prevent race conditions. Bug: 17360878 Change-Id: I779237d55dda4f35054a4d27fb2c660a38750fc0
|
2d5f39ed5aeaeb7ca22b07b4c6e8c56348ef8893 |
|
20-Sep-2014 |
Mathieu Chartier <mathieuc@google.com> |
Add ScopedAssertNoThreadSuspension Added a new class, ScopedAssertNoThreadSuspension. Deleted some unnecessary ScopedAssertNoThreadSuspension since VisitObjects already has a ScopedAssertNoThreadSuspension. Change-Id: I29ec0006120c39a27184d30e2d1d0c179e203776
|
1b636c661c3d21461fd072e542a9152212398f77 |
|
13-Aug-2014 |
Mathieu Chartier <mathieuc@google.com> |
Add allocation rate tracking to systrace. Bug: 16956980 (cherry picked from commit 837150818af0eee993f7d93c5a50c3c7b46f1dab) Change-Id: I3d0b18bfb9db24917f055f66f08f5f4168301867
|
69dbec6d9d55eeb2867949c2791d01dc9aa916c8 |
|
16-Sep-2014 |
Jeff Hao <jeffhao@google.com> |
Avoid suspending for alloc trace enabling when already suspended. Bug: 17499772 (cherry picked from commit 1d6ee090fddd4bfd35c304d6ceb929d5c529dfcc) Change-Id: Id09809c476c685f0a197ee75bb08638931364efd
|
2dbe627954fd78a3659ab3cd42d2ead5b4529441 |
|
16-Sep-2014 |
Mathieu Chartier <mathieuc@google.com> |
Add runtime options for large object space Adds the two following options: Option -XX:LargeObjectSpace={freelist, map, disabled} Option -XX:LargeObjectThreshold=size specifies the size for which primitive arrays are allocated in the large object space. Added handling for large object space == null in collectors. Fixed an error in the mem map space where we didn't use the page aligned size LOS for bytes allocated, this resutled in heaps appearing a bit smaller than they should be. Change-Id: I6f17c3534b59e7dc68cd375153e7a846799b3da4
|
1d6ee090fddd4bfd35c304d6ceb929d5c529dfcc |
|
16-Sep-2014 |
Jeff Hao <jeffhao@google.com> |
Avoid suspending for alloc trace enabling when already suspended. Bug: 17499772 Change-Id: Id98c10967b28e8859e5ac46f5878c304fb85c498
|
af4edbd2b77fef0eee3827eb30cc1a0e8e6efeb1 |
|
09-Sep-2014 |
Mathieu Chartier <mathieuc@google.com> |
Fix and re-enable FreeList large object space for 64 bit Not enabled on 32 bit due to virtual memory fragmentation concerns. The new free list large object space ensures that allocations are page aligned by using a side table for accounting data. (cherry picked from commit 66e222aa48e6d2fe4c78a1df938364b82bc83e72) Change-Id: Idbcbe75cb86b6d9b3d8b20f3048631a48c511458
|
66e222aa48e6d2fe4c78a1df938364b82bc83e72 |
|
09-Sep-2014 |
Mathieu Chartier <mathieuc@google.com> |
Fix and re-enable FreeList large object space for 64 bit Not enabled on 32 bit due to virtual memory fragmentation concerns. The new free list large object space ensures that allocations are page aligned by using a side table for accounting data. Bug: 17414549 Change-Id: Idbcbe75cb86b6d9b3d8b20f3048631a48c511458
|
30cbbee37d9fcca1a39b3681434180102ee5251a |
|
08-Sep-2014 |
Mathieu Chartier <mathieuc@google.com> |
Ignore heap trim requests if we are the zygote Done to prevent app launching lag due to sleep in heap trimmer daemon. Bug: 17310019 (cherry picked from commit f81bfa3e21c8a4e031505470ea954c93949cb30b) Change-Id: I3942d465781218aa04f7edc899ea87aa091f3cf7
|
b27285583ca40253b76010948420a91b45f79257 |
|
08-Sep-2014 |
Mathieu Chartier <mathieuc@google.com> |
Revert "Fix heap trimmer daemon sleeping." This reverts commit 698b44634396e8111e96e1116586fde89a838347. (cherry picked from commit 4d3981c72a546b87c8f5d391ff8b5135b8ca99a7) Change-Id: I7245bc08ebb95c12e7cc71b97edf9ca11ffbdf61
|
f81bfa3e21c8a4e031505470ea954c93949cb30b |
|
08-Sep-2014 |
Mathieu Chartier <mathieuc@google.com> |
Ignore heap trim requests if we are the zygote Done to prevent app launching lag due to sleep in heap trimmer daemon. Bug: 17310019 Change-Id: Ia593e7eced1c1583771985ec9e7b60ee0c0e7912
|
4d3981c72a546b87c8f5d391ff8b5135b8ca99a7 |
|
08-Sep-2014 |
Mathieu Chartier <mathieuc@google.com> |
Revert "Fix heap trimmer daemon sleeping." This reverts commit 698b44634396e8111e96e1116586fde89a838347. Change-Id: Ifa8c2d554b82289cc31803ad6027735d2c3c9be8
|
1f0437ecd88bef4a40e587283b02785839bac4b8 |
|
05-Sep-2014 |
Mathieu Chartier <mathieuc@google.com> |
Delete double finalization hack. No longer necessary. Change-Id: Ie5eb9e9ce4b8473d3b3e65bd108f93223b9a80dd
|
23d683ff957ed9967a045ad3da61f4a4e3c99f2a |
|
04-Sep-2014 |
Mathieu Chartier <mathieuc@google.com> |
Fix heap trimmer daemon sleeping. Problem: Heap trimmer daemon sleeping caused app launch occasionally to take a while due stopping the heap trimming thread taking a long time. The heap trimmer thread now never sleeps, we prevent issues caused by frequent back and forth process state changes by only transitioning to background if it has been kCollectorTransitionWait time since the last transition to background. Similar logic for heap trimming. (cherry picked from commit 698b44634396e8111e96e1116586fde89a838347) Change-Id: I5b2894e92eb79351eec35078d49c8457d2fd67a8
|
698b44634396e8111e96e1116586fde89a838347 |
|
04-Sep-2014 |
Mathieu Chartier <mathieuc@google.com> |
Fix heap trimmer daemon sleeping. Problem: Heap trimmer daemon sleeping caused app launch occasionally to take a while due stopping the heap trimming thread taking a long time. The heap trimmer thread now never sleeps, we prevent issues caused by frequent back and forth process state changes by only transitioning to background if it has been kCollectorTransitionWait time since the last transition to background. Similar logic for heap trimming. Bug: 17310019 Change-Id: I23980421cc388f36b66a4c03ed15dd11d43f59b5
|
8ec31f9835a8d1513be9be7f9fa236fe4715750d |
|
03-Sep-2014 |
Mathieu Chartier <mathieuc@google.com> |
Fix native allocation watermark clamping. The main issue causing the test to fail is that native_footprint_gc_watermark_ becoming > growth_limit_ due to no clamping. Temporary runFinalization fix is calling runFinalization 2x. Bug: 17371542 (cherry picked from commit 4c7fc5950853b0c368e2148db77ced7c4d3c303c) Change-Id: I05b85e95560c32c33d53bc96abf87d5262007395
|
4c7fc5950853b0c368e2148db77ced7c4d3c303c |
|
03-Sep-2014 |
Mathieu Chartier <mathieuc@google.com> |
Fix native allocation watermark clamping. The main issue causing the test to fail is that native_footprint_gc_watermark_ becoming > growth_limit_ due to no clamping. Temporary runFinalization fix is calling runFinalization 2x. Bug: 17371542 Change-Id: I188cb530a44dd109e066a22091f12f8d2d4350c3
|
f4f3843150bb2152bcc583c1896f45a313d5f6a4 |
|
03-Sep-2014 |
Mathieu Chartier <mathieuc@google.com> |
Add exception check to AllocateInternalWithGc Trying to figure out if the pending exception comes before or during AllocateInternalWithGc. Bug: 17164348 (cherry picked from commit 98d43cb0da3c34d1888d1e31d953c2940fd0f897) Change-Id: I2aac4b67f0c3f1c0fe3c9dc321316f76494c4074
|
98d43cb0da3c34d1888d1e31d953c2940fd0f897 |
|
03-Sep-2014 |
Mathieu Chartier <mathieuc@google.com> |
Add exception check to AllocateInternalWithGc Trying to figure out if the pending exception comes before or during AllocateInternalWithGc. Bug: 17164348 Change-Id: Id46d82bfc0f84d16e5ffdafe41658aee4cc2c702
|
08487454218c2bfee6a9d669622c9ed935408783 |
|
03-Sep-2014 |
Mathieu Chartier <mathieuc@google.com> |
Change native allocations to use growth limit. Previously native allocation tracking used a GC footprint limit which would cause GC in the allocating thread. This prevented excessive growth of the heap but could cause jank due to GC in the allocating thread. The new behavior is using the growth_limit instead of the native footprint limit. (cherry picked from commit d9819ecc0bc21a2bb356a4de9b013e36fe618627) Change-Id: Ia40ed830e8c674cc49d4c0a6fd773d6cb8ff97fa
|
d9819ecc0bc21a2bb356a4de9b013e36fe618627 |
|
03-Sep-2014 |
Mathieu Chartier <mathieuc@google.com> |
Change native allocations to use growth limit. Previously native allocation tracking used a GC footprint limit which would cause GC in the allocating thread. This prevented excessive growth of the heap but could cause jank due to GC in the allocating thread. The new behavior is using the growth_limit instead of the native footprint limit. Bug: 17006948 Change-Id: I40f30af09bb25596a9f57fa50e2a155fb947b5fe
|
98172a66f14fd8c6ebce4240a3bb2eaa69eb16bc |
|
02-Sep-2014 |
Mathieu Chartier <mathieuc@google.com> |
Change heap transitions + hspace compation to use VLOG(heap) VLOG(gc) is spammy since it is enabled. (cherry picked from commit 8bd2961b385c870953e650c253a04ee24b76809b) Change-Id: Id75256cdc6a9802818bb56f77533cca88ace42a6
|
8bd2961b385c870953e650c253a04ee24b76809b |
|
02-Sep-2014 |
Mathieu Chartier <mathieuc@google.com> |
Change heap transitions + hspace compation to use VLOG(heap) VLOG(gc) is spammy since it is enabled. Change-Id: I07d1d40e2f19134f885d6777b60533a9010ae164
|
bad0267eaab9d6a522d05469ff90501deefdb88b |
|
25-Aug-2014 |
Mathieu Chartier <mathieuc@google.com> |
Add native memory accounting through custom allocator. Added a custom allocator that lets you pass in a special tag which specifices where the allocation came from. This is used when dumping. The performance overhead is low since each allocation only does a atomic add/sub for each allocation/free. The measurements are dumped to traces.txt during SIGQUIT. Example output: I/art (27274): AllocatorTagHeap active=120 max=120 total=168 I/art (27274): AllocatorTagMonitorList active=1572 max=6240 total=11724 I/art (27274): AllocatorTagClassTable active=185208 max=185208 total=268608 I/art (27274): AllocatorTagInternTable active=430368 max=430368 total=436080 I/art (27274): AllocatorTagMaps active=5616 max=6168 total=34392 I/art (27274): AllocatorTagLOS active=1024 max=1536 total=2044 I/art (27274): AllocatorTagSafeMap active=0 max=51936 total=533688 I/art (27274): AllocatorTagLOSMaps active=144 max=1248 total=5760 I/art (27274): AllocatorTagReferenceTable active=10944 max=11840 total=19136 I/art (27274): AllocatorTagHeapBitmap active=32 max=40 total=56 I/art (27274): AllocatorTagHeapBitmapLOS active=8 max=8 total=8 I/art (27274): AllocatorTagVerifier active=0 max=18844 total=1073156 I/art (27274): AllocatorTagModUnionCardSet active=5300 max=5920 total=56020 I/art (27274): AllocatorTagModUnionReferenceArray active=24864 max=24864 total=24864 I/art (27274): AllocatorTagJNILibrarires active=320 max=320 total=320 I/art (27274): AllocatorTagOatFile active=1400 max=1400 total=5852 Change-Id: Ibb470ef2e9c9a24563bb46422d46a55799704d82 (cherry picked from commit 5369c40f75fdcb1be7a7c06db212ce965c83a164)
|
5369c40f75fdcb1be7a7c06db212ce965c83a164 |
|
25-Aug-2014 |
Mathieu Chartier <mathieuc@google.com> |
Add native memory accounting through custom allocator. Added a custom allocator that lets you pass in a special tag which specifices where the allocation came from. This is used when dumping. The performance overhead is low since each allocation only does a atomic add/sub for each allocation/free. The measurements are dumped to traces.txt during SIGQUIT. Example output: I/art (27274): AllocatorTagHeap active=120 max=120 total=168 I/art (27274): AllocatorTagMonitorList active=1572 max=6240 total=11724 I/art (27274): AllocatorTagClassTable active=185208 max=185208 total=268608 I/art (27274): AllocatorTagInternTable active=430368 max=430368 total=436080 I/art (27274): AllocatorTagMaps active=5616 max=6168 total=34392 I/art (27274): AllocatorTagLOS active=1024 max=1536 total=2044 I/art (27274): AllocatorTagSafeMap active=0 max=51936 total=533688 I/art (27274): AllocatorTagLOSMaps active=144 max=1248 total=5760 I/art (27274): AllocatorTagReferenceTable active=10944 max=11840 total=19136 I/art (27274): AllocatorTagHeapBitmap active=32 max=40 total=56 I/art (27274): AllocatorTagHeapBitmapLOS active=8 max=8 total=8 I/art (27274): AllocatorTagVerifier active=0 max=18844 total=1073156 I/art (27274): AllocatorTagModUnionCardSet active=5300 max=5920 total=56020 I/art (27274): AllocatorTagModUnionReferenceArray active=24864 max=24864 total=24864 I/art (27274): AllocatorTagJNILibrarires active=320 max=320 total=320 I/art (27274): AllocatorTagOatFile active=1400 max=1400 total=5852 Bug: 16238192 Change-Id: Ibb470ef2e9c9a24563bb46422d46a55799704d82
|
e1cb298bbd15141a55b5a760448a2402681fd1fc |
|
27-Aug-2014 |
Andreas Gampe <agampe@google.com> |
ART: Check for no gaps only when we will have an immune region In dex2oat, for example, this is not necessary. This CL enables running dex2oat under valgrind. Change-Id: Ia25c7bfb4903a613c80f4685030970b2a48e24f9
|
b68c6e578a28a9717d78dfd522d9d9b8befaedf2 |
|
19-Aug-2014 |
Mathieu Chartier <mathieuc@google.com> |
Reduce interpret-only compile time. Before: 39.04user 5.18system 0:29.24elapsed 151%CPU (0avgtext+0avgdata 164176maxresident)k 38.87user 5.16system 0:29.14elapsed 151%CPU (0avgtext+0avgdata 164144maxresident)k After: 36.26user 3.25system 0:27.00elapsed 146%CPU (0avgtext+0avgdata 162592maxresident)k 36.25user 3.28system 0:26.28elapsed 150%CPU (0avgtext+0avgdata 162688maxresident)k Disabled implicit stack protection for the compiler, this reduces page faults. Added support for not timing every method compilation and verification. NanoTime is slow and adds ~2 seconds of real time. This is currently enabled since people want to know which methods are slow to compile. Bug: 16853450 (cherry picked from commit 8e219ae27624116b6d23e858fb21e93342f81d66) Change-Id: I349ffb3f36db8c437137387aa6914dc17d743f09
|
8e219ae27624116b6d23e858fb21e93342f81d66 |
|
19-Aug-2014 |
Mathieu Chartier <mathieuc@google.com> |
Reduce interpret-only compile time. Before: 39.04user 5.18system 0:29.24elapsed 151%CPU (0avgtext+0avgdata 164176maxresident)k 38.87user 5.16system 0:29.14elapsed 151%CPU (0avgtext+0avgdata 164144maxresident)k After: 36.26user 3.25system 0:27.00elapsed 146%CPU (0avgtext+0avgdata 162592maxresident)k 36.25user 3.28system 0:26.28elapsed 150%CPU (0avgtext+0avgdata 162688maxresident)k Disabled implicit stack protection for the compiler, this reduces page faults. Added support for not timing every method compilation and verification. NanoTime is slow and adds ~2 seconds of real time. This is currently enabled since people want to know which methods are slow to compile. Bug: 16853450 Change-Id: I349ffb3f36db8c437137387aa6914dc17d743f09
|
e4927f6654b7eda672312898e1fd3fecccacd6aa |
|
23-Aug-2014 |
Mathieu Chartier <mathieuc@google.com> |
Fix race condition in TransitionCollector. There was a minor race condition that could happen if multiple threads called TransitionCollector at the same time. Starting out in CMS: Thread 1: TransitionCollector(SS). Thread 2: TransitionCollector(CMS) sees that it is already CMS so has copying_transition == false. But then thread 2 changes to SS. Thread 1 resumes but incorrectly doesn't check the disable_moving_gc_count_ possibly resulting in errors if disable_moving_gc_count_ != 0 due to JNI since we are going from SS -> CMS and are goign to move objects. (cherry picked from commit de2233bbf64c7dde96513a729f6a97aebc2f0424) Change-Id: I2fdda85f7cb7cbb0df3d1466a3c74853c5304c1b
|
de2233bbf64c7dde96513a729f6a97aebc2f0424 |
|
23-Aug-2014 |
Mathieu Chartier <mathieuc@google.com> |
Fix race condition in TransitionCollector. There was a minor race condition that could happen if multiple threads called TransitionCollector at the same time. Starting out in CMS: Thread 1: TransitionCollector(SS). Thread 2: TransitionCollector(CMS) sees that it is already CMS so has copying_transition == false. But then thread 2 changes to SS. Thread 1 resumes but incorrectly doesn't check the disable_moving_gc_count_ possibly resulting in errors if disable_moving_gc_count_ != 0 due to JNI since we are going from SS -> CMS and are goign to move objects. Bug: 17189964 Change-Id: I4f0d002717516b81355d66f26e0e8ebe3958348d
|
c44ce2e9e88443d931443aa7ee738e4c43e1a12d |
|
26-Aug-2014 |
Mathieu Chartier <mathieuc@google.com> |
Map heap maps at a lower address. We now map the heap mmaps at a lower address in case the app needs larger continuous address space. Bug: 16502380 (cherry picked from commit 18bacb60e09fa8aa20ae0a1d7a4a8968d4913fb0) Change-Id: I66447f853e439448c72923e2d1c657c94c5f1543
|
91c2f71bb518f5dcb9e01b4dbb136c5bec9e3a65 |
|
26-Aug-2014 |
Mathieu Chartier <mathieuc@google.com> |
Reduce GC log spam. Homogeneous compaction and collector transitions now print to VLOG(gc) instead of LOG(INFO). Bug: 17166556 (cherry picked from commit 0ab56e95e203806dae347056d3331a3e6037457d) Change-Id: I33157ca27da86cbb741759bb0bda6d38d1f5bfcd
|
0ab56e95e203806dae347056d3331a3e6037457d |
|
26-Aug-2014 |
Mathieu Chartier <mathieuc@google.com> |
Reduce GC log spam. Homogeneous compaction and collector transitions now print to VLOG(gc) instead of LOG(INFO). Bug: 17166556 Change-Id: I5d54acf36a9b2763922e6329596a2f191d45535c
|
18bacb60e09fa8aa20ae0a1d7a4a8968d4913fb0 |
|
26-Aug-2014 |
Mathieu Chartier <mathieuc@google.com> |
Map heap maps at a lower address. We now map the heap mmaps at a lower address in case the app needs larger continuous address space. Bug: 16502380 Change-Id: I2cc11d0c207c0eae8db0c5025a48b11119c5a802
|
507e6180ad271eb719c67ce7394852c731d975a5 |
|
19-Aug-2014 |
Alex Light <allight@google.com> |
Support running without a boot image. Bug: 17000769 (cherry picked from commit 64ad14dbe2225441fb7734bf6d89358d96692eea) Change-Id: I6404d5050c8a2f4ee6e70d58532eb25ee9de248e
|
64ad14dbe2225441fb7734bf6d89358d96692eea |
|
19-Aug-2014 |
Alex Light <allight@google.com> |
Support running without a boot image. Bug: 17000769 Change-Id: I6404d5050c8a2f4ee6e70d58532eb25ee9de248e
|
6a7824dc81aaab3cb09ced16affca72d1b1da649 |
|
22-Aug-2014 |
Mathieu Chartier <mathieuc@google.com> |
Add fallback for non moving space being full. When the non moving space becomes full, we disable moving GC and make the main space the new non moving space. Also added a runtime option for changing the non moving space size: -XX:NonMovingSpaceCapacity. Bug: 17189964 (cherry picked from commit 4c5a469683e433f126c9863cd393747d2e7c4a29) Change-Id: If82e3c6f8a0f389e37e14a0b1e6d5126d571fd7a
|
4c5a469683e433f126c9863cd393747d2e7c4a29 |
|
22-Aug-2014 |
Mathieu Chartier <mathieuc@google.com> |
Add fallback for non moving space being full. When the non moving space becomes full, we disable moving GC and make the main space the new non moving space. Also added a runtime option for changing the non moving space size: -XX:NonMovingSpaceCapacity. Bug: 17189964 Change-Id: I04d00d0f457f6c1f5724bf32932b6b6ce4d341b1
|
0deeb815d32be7c98d8b1567db3e8f8d190b6d3b |
|
22-Aug-2014 |
Mathieu Chartier <mathieuc@google.com> |
Fix testing wrong variable for non zygote. For non zygote we want to only have a single non moving space to let dex2oat use RosAlloc for all allocations. Fixed stale low memory logic in parsed options. Bug: 17189964 (cherry picked from commit a12c2a945fe3f10d3ed31aa5db3e422cc1ad7f98) Change-Id: I4fc00b277db6780ed410eab4cd969e8f004d5348
|
a12c2a945fe3f10d3ed31aa5db3e422cc1ad7f98 |
|
22-Aug-2014 |
Mathieu Chartier <mathieuc@google.com> |
Fix testing wrong variable for non zygote. For non zygote we want to only have a single non moving space to let dex2oat use RosAlloc for all allocations. Fixed stale low memory logic in parsed options. Bug: 17189964 Change-Id: I85a565002fd18ae30105df084796521abd60ea12
|
e4cab17634dc6d5809b40f2ed80d6459734ae2fe |
|
20-Aug-2014 |
Mathieu Chartier <mathieuc@google.com> |
Enable large object space for zygote. We now enable the large object space before the zygote fork. This reduces the size of the zygote and removes the need for excessive explicit GCs during phone booting. Changed the card set mod union table to support forgetting cards. If a card has no non null references which are in another space then it is removed from the set. Added logging of the zygote size when you do a SIGQUIT. Dalvik PSS is the same or slightly lower (1-3%). Zygote space size: Before: 15MB After: 8MB (+ some large objects). TODO: Combine remembered sets and mod union tables into a single interface. Bug: 16398684 Change-Id: Ie48cdf35004a0a37eedb1ccc1bf214b1fa9e0cca
|
6724d8649ab73e4fb86c8014bda51b13bddf2f3f |
|
19-Aug-2014 |
Mathieu Chartier <mathieuc@google.com> |
Fix heap corruption and verification. There was a faulty assumption that space End() was always aligned to card boundaries. This was true for all spaces other than the image and resulted in heap corruption when the last object of the image space contained a reference to an object in another space. Also fixed an error where we called the pre GC verification post GC. Bug: 17080623 Change-Id: I041ee564518f53b79c6e8dc2ad782a3152577a4e
|
d35326fc45ef71d88b82fd5fe6875ae07f3646cb |
|
19-Aug-2014 |
Mathieu Chartier <mathieuc@google.com> |
Fix heap corruption and verification. There was a faulty assumption that space End() was always aligned to card boundaries. This was true for all spaces other than the image and resulted in heap corruption when the last object of the image space contained a reference to an object in another space. Also fixed an error where we called the pre GC verification post GC. Bug: 17080623 (cherry picked from commit 6724d8649ab73e4fb86c8014bda51b13bddf2f3f) Change-Id: I931149421c738653863eb6105dfdf7ecd750601a
|
837150818af0eee993f7d93c5a50c3c7b46f1dab |
|
13-Aug-2014 |
Mathieu Chartier <mathieuc@google.com> |
Add allocation rate tracking to systrace. Bug: 16956980 Change-Id: I7074f4ae0f75d1bb58e9860ded4e17ce6978d74e
|
cb6b0f31ede2275e79e6199ec391147585a37a2a |
|
12-Aug-2014 |
Ian Rogers <irogers@google.com> |
Avoid use of std::string where we have const char*. Removing the ClassHelper caused std::string creation for all calls to Class::GetDescriptor and a significant performance regression. Make the std::string an out argument so the caller can maintain it and its life time while allowing GetDescriptor to return the common const char* case. Don't generate GC maps when compilation is disabled. Remove other uses of std::string that are occuring on critical paths. Use the cheaper SkipClass in CompileMethod in CompilerDriver. Specialize the utf8 as utf16 comparison code for the common shorter byte encoding. Force a bit of inlining, remove some UNLIKELYs (they are prone to pessimizing code), add some LIKELYs. x86-64 host 1-thread interpret-only of 57 apks: Before: 29.539s After: 23.467s Regular compile: Before: 1m35.347s After: 1m20.056s Bug: 16853450 Change-Id: Ic705ea24784bee24ab80084d06174cbf87d557ad Conflicts: runtime/utils.cc
|
1ff3c98775a4577cf053dba9a0c2d5c21c07b298 |
|
12-Aug-2014 |
Ian Rogers <irogers@google.com> |
Avoid use of std::string where we have const char*. Removing the ClassHelper caused std::string creation for all calls to Class::GetDescriptor and a significant performance regression. Make the std::string an out argument so the caller can maintain it and its life time while allowing GetDescriptor to return the common const char* case. Don't generate GC maps when compilation is disabled. Remove other uses of std::string that are occuring on critical paths. Use the cheaper SkipClass in CompileMethod in CompilerDriver. Specialize the utf8 as utf16 comparison code for the common shorter byte encoding. Force a bit of inlining, remove some UNLIKELYs (they are prone to pessimizing code), add some LIKELYs. x86-64 host 1-thread interpret-only of 57 apks: Before: 29.539s After: 23.467s Regular compile: Before: 1m35.347s After: 1m20.056s Bug: 16853450 Change-Id: Ic705ea24784bee24ab80084d06174cbf87d557ad
|
b225890e02bc8d5864217743eaef306d5387e0e9 |
|
07-Aug-2014 |
Mathieu Chartier <mathieuc@google.com> |
Change FreeMemory and TotalMemory behavior. TotalMemory is now equal to the footprint limit (around when the next GC will occur). FreeMemory is now equal to TotalMemory() - bytes_allocated_. Also added more memory dumping info to DumpGcPerformanceInfo. Bug: 16520008 Bug: 15819878 (cherry picked from commit dd162fb5990cedf80a5093ecc0e77df82af5f754) Change-Id: I68239a5295cc1372b3995eb781d67b9e25d6eaed
|
c30a7257f1d0cc79931f38e8cbbb45aab8682acb |
|
12-Aug-2014 |
Mathieu Chartier <mathieuc@google.com> |
Prevent merge conflicts. Change-Id: I61af7f3c9be47d4776371dfe2b97850ea3f3101f
|
dd162fb5990cedf80a5093ecc0e77df82af5f754 |
|
07-Aug-2014 |
Mathieu Chartier <mathieuc@google.com> |
Change FreeMemory and TotalMemory behavior. TotalMemory is now equal to the footprint limit (around when the next GC will occur). FreeMemory is now equal to TotalMemory() - bytes_allocated_. Also added more memory dumping info to DumpGcPerformanceInfo. Bug: 16520008 Bug: 15819878 Change-Id: Ifa59a2f2136dd0704097411ee183925e6c387fae
|
68d8b42ddec39ec0174162d90d4abaa004d1983e |
|
17-Jul-2014 |
Ian Rogers <irogers@google.com> |
Wire up check JNI force copy mode. Increase check JNI checks. Break apart jni_internal.h in to jni_env_ext.h and java_vm_ext.h. Fix the abuse of ScopedObjectAccess/annotalysis by ScopedCheck in the case of VM routines. Make class loader override and shared library class loader JNI global references rather than mirror pointers. Clean-ups to native bridge. Change-Id: If7c6110b5aade7a402bfb67534af86a7b2cdeb55
|
104fa0c0c7dad925d9f4d5c101a8064cd6830da7 |
|
07-Aug-2014 |
Mathieu Chartier <mathieuc@google.com> |
Guard pause histogram with lock. There is a race condition since the GC was updating this without holding any locks. But the signal catcher could be dumping the timings with DumpGcPerformanceInfo at the same time. This could potentially cause out of bound errors, etc.. Also did a bit of cleanup. Bug: 15446488 Change-Id: Icaff19d872cc7f7d31c34e4ddaae97502454e09c
|
c1276c838d1d0896048b8c14458432b94274e869 |
|
07-Aug-2014 |
Hiroshi Yamauchi <yamauchi@google.com> |
Fix a SIGSEGV at background-to-foreground collector transition. The mem map that's used to create the backup main rosalloc space is set to PROT_NONE by the compaction and the rosalloc space creation attempts to write the debug magic number in the first page. This is a debug build only issue. Bug: 16854263 Change-Id: I3cc6b7288ee53c006366bb428fb245a909bc3db5
|
e0d6421cdb42508f4d36f28cc9eddc31271bb37a |
|
07-Aug-2014 |
Hiroshi Yamauchi <yamauchi@google.com> |
Fix a SIGSEGV at background-to-foreground collector transition. The mem map that's used to create the backup main rosalloc space is set to PROT_NONE by the compaction and the rosalloc space creation attempts to write the debug magic number in the first page. This is a debug build only issue. Cherry pick commit c1276c838d1d0896048b8c14458432b94274e869. Bug: 16854263 Change-Id: Ide2545d92bcafd3a095ac7f0c89c5b43d6dd78de
|
6bff7130878128c9836a21ae58d0cfdb0075b1b5 |
|
30-Jul-2014 |
Mathieu Chartier <mathieuc@google.com> |
Add support for bump pointer spaces to DdmSendHeapSegments. Added support for bump pointer spaces as well as differentiating between DlMallocSpaces and RosAllocSpaces. Added logic to reset the start of next chunk to prevent inbetween space regions counted as free. Fixed a debug build bug where we were doing an mprotect after creating a rosalloc space. In debug builds, this writes a magic value in the page. This was faulting since it was set to PROT_NONE. The fix moves the mprotect before the RosAlloc space creation. Bug: 16408851 (cherry picked from commit 36dab3607e77505ce139eacef1c62a1c4bc4affd) Change-Id: I5095feb01fa7e248178a2833da7f821f4fd52c89
|
36dab3607e77505ce139eacef1c62a1c4bc4affd |
|
30-Jul-2014 |
Mathieu Chartier <mathieuc@google.com> |
Add support for bump pointer spaces to DdmSendHeapSegments. Added support for bump pointer spaces as well as differentiating between DlMallocSpaces and RosAllocSpaces. Added logic to reset the start of next chunk to prevent inbetween space regions counted as free. Fixed a debug build bug where we were doing an mprotect after creating a rosalloc space. In debug builds, this writes a magic value in the page. This was faulting since it was set to PROT_NONE. The fix moves the mprotect before the RosAlloc space creation. Bug: 16408851 Change-Id: Ibe18198d05ff353fbb57d10b2f7719fdcbf1c5f0
|
b2ac1ab47f84bd989fb2c94a532f5dc7d177ebe4 |
|
25-Jul-2014 |
Mathieu Chartier <mathieuc@google.com> |
Fix main space memory leak and add checks. The hypothesis is that we were leaking the main space and its bitmaps, then eventually we would run out of virtual address space, which would cause a null bitmap (DCHECK). Finally when we tried adding the space with a null bitmap to the heap bitmap it segfaulted. Changed some non performance critical DCHECK -> CHECK. Bug: 16563323 (cherry picked from commit 2796a1669ae0f3b96db8432fbd8be1b93bf335c4) Change-Id: Ifa9d866c6c89eff22a547af4db70bc79a77690ed
|
2796a1669ae0f3b96db8432fbd8be1b93bf335c4 |
|
25-Jul-2014 |
Mathieu Chartier <mathieuc@google.com> |
Fix main space memory leak and add checks. The hypothesis is that we were leaking the main space and its bitmaps, then eventually we would run out of virtual address space, which would cause a null bitmap (DCHECK). Finally when we tried adding the space with a null bitmap to the heap bitmap it segfaulted. Changed some non performance critical DCHECK -> CHECK. Bug: 16563323 Change-Id: I08a1f873752e28ebcf63ebbd90f92d994d7ca96b
|
00b5915828f89daaefd9e8fb215658360f76762c |
|
25-Jul-2014 |
Mathieu Chartier <mathieuc@google.com> |
Fix dangling pointer bug when transitioning to background. Dangling pointer left behind from the old rosalloc / dlmalloc spaces. We now avoid using this pointer by using main_space_ and non_moving_space_ as well as clear the pointer when we remove the space. Bug: 16567203 Change-Id: Ida9ff30783e89cd4a4d86a4d0e912701692101f1
|
27c84b64bdd3302d8260c6f330513e484d97fc98 |
|
25-Jul-2014 |
Mathieu Chartier <mathieuc@google.com> |
Fix dangling pointer bug when transitioning to background. Dangling pointer left behind from the old rosalloc / dlmalloc spaces. We now avoid using this pointer by using main_space_ and non_moving_space_ as well as clear the pointer when we remove the space. Bug: 16567203 (cherry picked from commit 00b5915828f89daaefd9e8fb215658360f76762c) Change-Id: I5962929e4a0bb4db6f531d25ee322da7ab3f5dd4
|
4df72b8a198e2d649c6be76628d80d984cc33395 |
|
16-Jul-2014 |
Stephen Hines <srhines@google.com> |
Remove errors/warnings from tautological comparisons. Change-Id: I2728b08d55abccd14c111c6c9da93068d4e14275
|
79ce45ce0f57ed27f280507163b7ba954307e2ba |
|
16-Jul-2014 |
Stephen Hines <srhines@google.com> |
Add back a deleted check related to verification. Change-Id: Ib939d1a7395a4b6cc9a7256cfb0a3498ba296744
|
c0dcf29143051cf34d6c032a7b385ac4579bd4ec |
|
24-Jul-2014 |
Mathieu Chartier <mathieuc@google.com> |
Fix stale remembered sets error. We were forgetting to remove the remembered set in transition to background. This resulted in remembered sets being added for spaces which no longer existed. This finally caused an error when a new space happened to have the same address as the old space, resulting in a CHECK failure. Also tuned the number of ParallelGC to prevent spurrious failures and removed the ParallelGC from broken tests in the make file. Bug: 16532086 Bug: 16406852 Change-Id: I00bbcbd7daa03c867732d165be62b72e6c43bce1 (cherry picked from c5a8347ac491a5f521945d3835a322123830456b)
|
38c488bcd41ba632a646d7a1d790ec71a2fcf6fa |
|
16-Jul-2014 |
Mathieu Chartier <mathieuc@google.com> |
Recycle mem-maps for collector transitions. We now create spaces when we need them for collector transitions or homogeneous compaction by recycling mem maps. Change the bump pointer space size to be as large as the heap capacity instead of 1/2 heap capacity like it used to be. For GSS, bump pointer spaces are set to 32MB currently. Changed GSS to have main space == non moving space since we don't need to copy from the main space. Fixes GC stress tests 074, 096. Fixed test 080 oom throw with -Xmx2m for GC stress test, this was broken since it was allocating a 4 MB array before starting the OOM process. Bug: 14059466 Bug: 16406852 (cherry picked from commit b363f666883860d40823d5528df3c98c897f74f4) Change-Id: I62877cfa24ec944a6f34ffac30334f454a8002fd
|
b76cac637691c29daa9c44e493b5bc26346ed116 |
|
23-Jul-2014 |
Mathieu Chartier <mathieuc@google.com> |
Revert "Revert "Disable adding main and non moving spaces to immune region in GSS"" This reverts commit f85c2fb317399ab540854cd7551ac47690366543.
|
5189e24fb6d42c04c48169ab2f15de56ecf3c828 |
|
24-Jul-2014 |
Mathieu Chartier <mathieuc@google.com> |
Fix memory leak in RemoveRememberedSet. RemoveRememberedSet now deletes the remembered set. Bug: 16532086 Change-Id: I01092931cc20cd0688dd42eed3dde9ad140889b2
|
c5a8347ac491a5f521945d3835a322123830456b |
|
24-Jul-2014 |
Mathieu Chartier <mathieuc@google.com> |
Fix stale remembered sets error. We were forgetting to remove the remembered set in transition to background. This resulted in remembered sets being added for spaces which no longer existed. This finally caused an error when a new space happened to have the same address as the old space, resulting in a CHECK failure. Also tuned the number of ParallelGC to prevent spurrious failures and removed the ParallelGC from broken tests in the make file. Bug: 16532086 Bug: 16406852 Change-Id: I00bbcbd7daa03c867732d165be62b72e6c43bce1
|
b363f666883860d40823d5528df3c98c897f74f4 |
|
16-Jul-2014 |
Mathieu Chartier <mathieuc@google.com> |
Recycle mem-maps for collector transitions. We now create spaces when we need them for collector transitions or homogeneous compaction by recycling mem maps. Change the bump pointer space size to be as large as the heap capacity instead of 1/2 heap capacity like it used to be. For GSS, bump pointer spaces are set to 32MB currently. Changed GSS to have main space == non moving space since we don't need to copy from the main space. Fixes GC stress tests 074, 096. Fixed test 080 oom throw with -Xmx2m for GC stress test, this was broken since it was allocating a 4 MB array before starting the OOM process. Bug: 14059466 Bug: 16406852 Change-Id: I62877cfa24ec944a6f34ffac30334f454a8002fd
|
f85c2fb317399ab540854cd7551ac47690366543 |
|
22-Jul-2014 |
Mathieu Chartier <mathieuc@google.com> |
Revert "Disable adding main and non moving spaces to immune region in GSS" Bug: 16399257 This reverts commit be0562fb14e6754ee932b8d9c97e2a6df3a91119. Change-Id: I29e07a8fa1e972990e5bf1ddf8c9a3538ea5f9cf
|
be0562fb14e6754ee932b8d9c97e2a6df3a91119 |
|
14-Jul-2014 |
Mathieu Chartier <mathieuc@google.com> |
Disable adding main and non moving spaces to immune region in GSS Disabled adding the main and non moving space to the immune region. This will enable us to recycle bump pointer spaces for malloc space -> malloc space compaction as well as collector transitions. Also added logic for falling back to the non moving space, we may copy objects there. Refactored mod union table logic into MarkReachableObjects. No measurable performance benefit or regression. Bug: 14059466 Bug: 16291259 (cherry picked from commit 4c13a3ff475f206c4d0a86ee2595c45392fd942f) Change-Id: I858b4fbddca888e164052ad247565a0bdbea68b5
|
22c6a817ed3019455d22df13bd91faf012177ef6 |
|
16-Jul-2014 |
Stephen Hines <srhines@google.com> |
Add back a deleted check related to verification. Change-Id: Ib939d1a7395a4b6cc9a7256cfb0a3498ba296744
|
4c13a3ff475f206c4d0a86ee2595c45392fd942f |
|
14-Jul-2014 |
Mathieu Chartier <mathieuc@google.com> |
Disable adding main and non moving spaces to immune region in GSS Disabled adding the main and non moving space to the immune region. This will enable us to recycle bump pointer spaces for malloc space -> malloc space compaction as well as collector transitions. Also added logic for falling back to the non moving space, we may copy objects there. Refactored mod union table logic into MarkReachableObjects. No measurable performance benefit or regression. Bug: 14059466 Bug: 16291259 Change-Id: If663d9fdbde943b988173b7f6ac844e5f78a0327
|
b5f5649ba4c8cb51ce143ddbedd5e1549f08f8b3 |
|
16-Jul-2014 |
Stephen Hines <srhines@google.com> |
Remove errors/warnings from tautological comparisons. Change-Id: I2728b08d55abccd14c111c6c9da93068d4e14275
|
22d5e735f403c57525fe868304c7123f0ce66399 |
|
16-Jul-2014 |
Ian Rogers <irogers@google.com> |
Remove object_utils.h. Break into object_lock, field_helper and method_helper. Clean up header files following this. Also tidy some of the Handle code in response to compiler errors when resolving the changes in this CL. Change-Id: I73e63015a0f02a754d0866bfaf58208aebcaa295
|
f37a88b8e6db6c587fa449a12e40cb46be1689fc |
|
10-Jul-2014 |
Zuo Wang <zuo.wang@intel.com> |
ART: Compacting ROS/DlMalloc spaces with semispace copy GC Current semispace copy GC is mainly associated with bump pointer spaces. Though it squeezes fragmentation most aggressively, an extra copy is required to re-establish the data in the ROS/DlMalloc space to allow CMS GCs to happen afterwards. As semispace copy GC is still stop-the-world, this not only introduces unnecessary overheads but also longer response time. Response time indicates the time duration between the start of transition request and the start of transition animation, which may impact the user experience. Using semispace copy GC to compact the data in a ROS space to another ROS(or DlMalloc space to another DlMalloc) space solves this problem. Although it squeezes less fragmentation, CMS GCs can run immediately after the compaction. We apply this algorithm in two cases: 1) Right before throwing an OOM if -XX:EnableHSpaceCompactForOOM is passed in as true. 2) When app is switched to background if the -XX:BackgroundGC option has value HSpaceCompact. For case 1), OOMs are significantly delayed in the harmony GC stress test, with compaction ratio up to 0.87. For case 2), compaction ratio around 0.5 is observed in both built-in SMS and browser. Similar results have been obtained on other apps as well. Change-Id: Iad9eabc6d046659fda3535ae20f21bc31f89ded3 Signed-off-by: Wang, Zuo <zuo.wang@intel.com> Signed-off-by: Chang, Yang <yang.chang@intel.com> Signed-off-by: Lei Li <lei.l.li@intel.com> Signed-off-by: Lin Zang <lin.zang@intel.com>
|
654dd48e2230e16bfaa225decce72b52642e2f78 |
|
09-Jul-2014 |
Hiroshi Yamauchi <yamauchi@google.com> |
Improve the OOME fragmentation message. Change-Id: I390d3622f8d572ec7e34ea6dff9e1e0936e81ac1
|
a5b5c55c8585b7ce915f0c7e1f66d121a7f7a078 |
|
24-Jun-2014 |
Mathieu Chartier <mathieuc@google.com> |
Add notion of released vs empty pages to ROSAlloc. A notion of released vs empty pages helps get a more accurate view of how much memory was released during heap trimming. Otherwise we get that the same pages possibly get madvised multiple times without getting dirtied. Also enabled heap trimming of rosalloc spaces even when we care about jank. This is safe to do since the trimming process only acquires locks for short periods of time. Dalvik PSS reduces from ~52M to ~50M after boot on N4. Bug: 9969166 Change-Id: I4012e0a2554f413d18efe1a0371fe18d1edabaa9
|
f5997b4d3f889569d5a2b724d83d764bfbb8d106 |
|
20-Jun-2014 |
Mathieu Chartier <mathieuc@google.com> |
More advanced timing loggers. The new timing loggers have lower overhead since they only push into a vector. The new format has two types, a start timing and a stop timing. You can thing of these as brackets associated with a timestamp. It uses these to construct various statistics when needed, such as: Total time, exclusive time, and nesting depth. Changed PrettyDuration to have a default of 3 digits after the decimal point. Exaple of a GC dump with exclusive / total times and indenting: I/art (23546): GC iteration timing logger [Exclusive time] [Total time] I/art (23546): 0ms InitializePhase I/art (23546): 0.305ms/167.746ms MarkingPhase I/art (23546): 0ms BindBitmaps I/art (23546): 0ms FindDefaultSpaceBitmap I/art (23546): 0ms/1.709ms ProcessCards I/art (23546): 0.183ms ImageModUnionClearCards I/art (23546): 0.916ms ZygoteModUnionClearCards I/art (23546): 0.610ms AllocSpaceClearCards I/art (23546): 1.373ms AllocSpaceClearCards I/art (23546): 0.305ms/6.318ms MarkRoots I/art (23546): 2.106ms MarkRootsCheckpoint I/art (23546): 0.153ms MarkNonThreadRoots I/art (23546): 4.287ms MarkConcurrentRoots I/art (23546): 43.461ms UpdateAndMarkImageModUnionTable I/art (23546): 0ms/112.712ms RecursiveMark I/art (23546): 112.712ms ProcessMarkStack I/art (23546): 0.610ms/2.777ms PreCleanCards I/art (23546): 0.305ms/0.855ms ProcessCards I/art (23546): 0.153ms ImageModUnionClearCards I/art (23546): 0.610ms ZygoteModUnionClearCards I/art (23546): 0.610ms AllocSpaceClearCards I/art (23546): 0.549ms AllocSpaceClearCards I/art (23546): 0.549ms MarkRootsCheckpoint I/art (23546): 0.610ms MarkNonThreadRoots I/art (23546): 0ms MarkConcurrentRoots I/art (23546): 0.610ms ScanGrayImageSpaceObjects I/art (23546): 0.305ms ScanGrayZygoteSpaceObjects I/art (23546): 0.305ms ScanGrayAllocSpaceObjects I/art (23546): 1.129ms ScanGrayAllocSpaceObjects I/art (23546): 0ms ProcessMarkStack I/art (23546): 0ms/0.977ms (Paused)PausePhase I/art (23546): 0.244ms ReMarkRoots I/art (23546): 0.672ms (Paused)ScanGrayObjects I/art (23546): 0ms (Paused)ProcessMarkStack I/art (23546): 0ms/0.610ms SwapStacks I/art (23546): 0.610ms RevokeAllThreadLocalAllocationStacks I/art (23546): 0ms PreSweepingGcVerification I/art (23546): 0ms/10.621ms ReclaimPhase I/art (23546): 0.610ms/0.702ms ProcessReferences I/art (23546): 0.214ms/0.641ms EnqueueFinalizerReferences I/art (23546): 0.427ms ProcessMarkStack I/art (23546): 0.488ms SweepSystemWeaks I/art (23546): 0.824ms/9.400ms Sweep I/art (23546): 0ms SweepMallocSpace I/art (23546): 0.214ms SweepZygoteSpace I/art (23546): 0.122ms SweepMallocSpace I/art (23546): 6.226ms SweepMallocSpace I/art (23546): 0ms SweepMallocSpace I/art (23546): 2.144ms SweepLargeObjects I/art (23546): 0.305ms SwapBitmaps I/art (23546): 0ms UnBindBitmaps I/art (23546): 0.275ms FinishPhase I/art (23546): GC iteration timing logger: end, 178.971ms Change-Id: Ia55b65609468f212b3cd65cda66b843da42be645
|
48ab687d1f864fec93c2682de6fdc44ab784e2f8 |
|
24-Jun-2014 |
Mathieu Chartier <mathieuc@google.com> |
Add logging to monitor deflation. Change-Id: I0251ff19e0a3c3b9edc7c7e296f15eb3229f8f7c
|
10fb83ad7442c8cf3356a89ec918e0786f110981 |
|
16-Jun-2014 |
Mathieu Chartier <mathieuc@google.com> |
Shared single GC iteration accounting for all GCs. Previously, each garbage collector had data that was only used during collection. Since only one collector can be running at any given time, we can make this data be shared between all collectors. This reduces memory usage since we don't need to have redundant information for each GC types. Also reduced how much code is required to sweep spaces. Bug: 9969166 Change-Id: I31caf0ee4d572f75e0c66863fe7db12c08ae08e7
|
19d46b44f2abe742be22e32908dbfd9e6dd9bfea |
|
18-Jun-2014 |
Mathieu Chartier <mathieuc@google.com> |
Fix systrace logging, total paused time, and bytes saved message. Moved the GC top level systrace logging to be inside of Collector::Run. This prevents cases where we forgot to call it such as background compaction. Fixed a unit error regarding total pause time. Fixed negative bytes saved to use the word "expanded". Bug: 15702709 Change-Id: Ic2991ecad2daa000d0aee9d559b8bc77d8c160aa
|
52e4b43d62896b56f8c2bd041e528472bb4a0d8d |
|
10-Jun-2014 |
Mathieu Chartier <mathieuc@google.com> |
Add mark compact collector. The mark compact collector is a 4 phase collection, doing a normal full mark_sweep, calculating forwarding addresses of objects in the from space, updating references of objects in the from space, and moving the objects in the from space. Support is diabled by default since it needs to have non movable classes and field arrays. Performance numbers is around 50% as fast. The main advantage that this has over semispace is that the worst case memory usage is 50% since we only need one space isntead of two. TODO: Make field arrays and classes movable. This causes complication since Object::VisitReferences relies on these, so if we update the fields of an object but another future object uses this object to figure out what fields are reference fields it doesn't work. Bug: 14059466 Change-Id: I661ed3b71ad4dde124ef80312c95696b4a5665a1
|
96bcd45e8bd9ab5a50e005fdaf4448e2c53283ec |
|
17-Jun-2014 |
Mathieu Chartier <mathieuc@google.com> |
Fix error with remembered sets creation. There was an error where we were not re-creating the remembered sets in PreZygoteFork. This caused a rare check failure due to the stale remembered set occasionally having the same space as the newly created one. Bug: 15680452 Change-Id: Ibfa569e67ad0ff032f3e9696a99b992a18583243
|
308351ada0008b0cbe1a5afc31c302c975554ee4 |
|
15-Jun-2014 |
Mathieu Chartier <mathieuc@google.com> |
Change reference processing to use heap references. Removes several SetReferents for updating moved referents. Cleaned up other aspects of the code. Change-Id: Ibcb4d713fadea617efee7e936352ddf77ff4c370
|
d30e1d6b477650366c25822f956202fec041e1d5 |
|
09-Jun-2014 |
Mathieu Chartier <mathieuc@google.com> |
Fix GetFreeMemory to use fooprint limit instead of max memory. Based on definitions in: http://developer.android.com/reference/java/lang/Runtime.html Bug: 15507122 Change-Id: I02f34682d7ac2d379a07631b5207b6cfb224da6b
|
aff59a8a4eb976fbac371cc416fc5ffb117cd6c7 |
|
07-Jun-2014 |
Mathieu Chartier <mathieuc@google.com> |
Add missing initializtaion of last_gc_time_ns_. Fixes some valgrind warnings. Bug: 15426766 Change-Id: Ibaa78465739bf6919509cf87c72b25c84ed1d12c
|
3eed93dd5be03e5539827bebf0f414251a12e15e |
|
04-Jun-2014 |
Hiroshi Yamauchi <yamauchi@google.com> |
Verify there's no mem map gap for immune region not to break. This adds code that verifies that there's no memory map gap between the image space and the main space so that the immune region functionality won't silently break. For example, if there's a gap and a large object is allocated in that gap, the large object is incorrectly part of the immune region and the marking breaks. Bug: 14059466 Change-Id: Ie6ed82988d74b6d0562ebbbaac96ee43c15b14a6
|
9db911eb76976fc1c73c8e563beb3620f1cadf99 |
|
04-Jun-2014 |
Mathieu Chartier <mathieuc@google.com> |
Print mutexes held in Thread::Dump. Should help finding and fixing thread suspend timeout issues. Bug: 15328839 Change-Id: I30a10529cec0716c7571a0318e9f66be54734fd8
|
ffddfdf6fec0b9d98a692e27242eecb15af5ead2 |
|
03-Jun-2014 |
Tim Murray <timmurray@google.com> |
DO NOT MERGE Merge ART from AOSP to lmp-preview-dev. Change-Id: I0f578733a4b8756fd780d4a052ad69b746f687a9
|
8e1ebf467a9c8fa504d7a90e03df6053ecdceeb3 |
|
30-May-2014 |
Mathieu Chartier <mathieuc@google.com> |
Change GetFreeMemory to use the growth limit. This makes more sense since it is what the allocator uses. Also fixed somewhere where we were not properly passing in whether or not it was a large object allocation. Bug: 15327879 Change-Id: Ieab7af5427f5cdc2760390186b67e2c96d4bafa7
|
4240c5112aedb174a3e1c1f071ea54e82168b130 |
|
27-May-2014 |
Mathieu Chartier <mathieuc@google.com> |
Don't create bump pointer spaces unless necessary. We now only create these spaces if the foreground or background collector is a moving collector. Bug: 13564922 Bug: 14059466 Change-Id: I9f83c7881bc28423b78d5249c8e8854add91b60c
|
c179016fe188bef09487e777aa0fd861f5cdf067 |
|
23-May-2014 |
Mathieu Chartier <mathieuc@google.com> |
Add reserve area to allocation stacks. This fixes an issue with heap verification which was caused when the allocation stack overflowed. This resulted in heap verification failures since we were storing the newly allocated object in a handle scope without having it be live either in the live bitmap or allocation stack. We now push the object in the reserve area before we do a GC due to allocation stack overflow. Change-Id: I83b42c4b3250d7eaab1b49e53066e21c8656a740
|
c4ddc042eaf5232a3f9b111f42af39eeab6e0294 |
|
13-May-2014 |
Christopher Ferris <cferris@google.com> |
Add support for jemalloc instead of dlmalloc. Bug: 981363 Change-Id: I226ce3249c0d982eb1a9fdb9d04b25737f77345d
|
e9e55ac9f68b74a0fcd208685082fd6a1e89a51e |
|
22-May-2014 |
Mathieu Chartier <mathieuc@google.com> |
Fix build. Old Atomic things were rebased over. Change-Id: I437041af3247c316f2a75f5ef4bd35286fc8e2b1
|
8e4a96d9a7ba7c555032ef583a089ebd2c53f5f7 |
|
21-May-2014 |
Mathieu Chartier <mathieuc@google.com> |
Change zygote_creation_lock_ to be member instead of static. Static variables aren't thread safe and could cause the zygote to be created twice. Bug: 15133494 Change-Id: I65c8f089bed8de93f895b62b3dcff4c936931860
|
3e5cf305db800b2989ad57b7cde8fb3cc9fa1b9e |
|
21-May-2014 |
Ian Rogers <irogers@google.com> |
Begin migration of art::Atomic to std::atomic. Change-Id: I4858d9cbed95e5ca560956b9dabd976cebe68333
|
8ab7e78be6835d63a2cee9f234334ed8fb409781 |
|
20-May-2014 |
Mathieu Chartier <mathieuc@google.com> |
Improve heap verification for invalid roots. The new root verification prints the root type and owner thread id as well as the type of the object. Also a bit of work for planned multi-threaded verification. Bug: 14289301 Change-Id: Ia73c517dc11ec6dd82f3d945604ee3836b3db536
|
700a402244a1a423da4f3ba8032459f4b65fa18f |
|
20-May-2014 |
Ian Rogers <irogers@google.com> |
Now we have a proper C++ library, use std::unique_ptr. Also remove the Android.libcxx.mk and other bits of stlport compatibility mechanics. Change-Id: Icdf7188ba3c79cdf5617672c1cfd0a68ae596a61
|
f832284dd847ff077577bb5712225430bbbb3b67 |
|
16-May-2014 |
Mathieu Chartier <mathieuc@google.com> |
Delete ClassHelper and fix compaction bug in GetDirectInterface Cleanup helps to prevent compaction bugs. Fixed a fairly serious compaction error caused by calling ClassHelper::GetDirectInterface without handling the case where it causes thread suspension due to ResolveType. Bug: 8981901 Change-Id: I82b3bb6dd48d21eb6ece7aae0733c4a23c2bc408
|
507dfdd147c97bfbadebfd63584d094b6a4e7b47 |
|
16-May-2014 |
Ian Rogers <irogers@google.com> |
Compatibility layer to transition from UniquePtr to std::unique_ptr. Use ART_WITH_STLPORT (enabled for the target) to cause the use of UniquePtr, for the host switch to std::unique_ptr. For now the type remains called UniquePtr. Make dalvik compile with clang on the host, move its build to C++11. Change-Id: I5ba8d2757904bc089ed62047ea03de3c0853fb12
|
eb8167a4f4d27fce0530f6724ab8032610cd146b |
|
08-May-2014 |
Mathieu Chartier <mathieuc@google.com> |
Add Handle/HandleScope and delete SirtRef. Delete SirtRef and replaced it with Handle. Handles are value types which wrap around StackReference*. Renamed StackIndirectReferenceTable to HandleScope. Added a scoped handle wrapper which wraps around an Object** and restores it in its destructor. Renamed Handle::get -> Get. Bug: 8473721 Change-Id: Idbfebd4f35af629f0f43931b7c5184b334822c7a
|
a6a8d142e60076db1ed6035119856779533bd09e |
|
13-May-2014 |
Hiroshi Yamauchi <yamauchi@google.com> |
Fix a lock level violation with background compaction enabled. Bug: 14840305 Change-Id: I19f3d26af0c4f9c5a2843e0d95c8c10391cc38b1
|
78f7b4c04ab6e8b5581921bc95b67a9beee1c246 |
|
06-May-2014 |
Mathieu Chartier <mathieuc@google.com> |
Add concurrent reference processing. Concurrent reference processing currently works by going into native code from java.lang.ref.Reference.get(). From there, we have a fast path if the references aren't being processed which returns the referent without needing to access any locks. In the slow path we block until reference processing is complete. It may be possible to improve the slow path if the referent is blackened. TODO: Investigate doing the fast path in java code by using racy reads of a static volatile boolean. This will work as long as there are no suspend points inbetween the boolean read and referent read. Bug: 14381653 Change-Id: I1546b55be4691fe4ff4aa6d857b234cce7187d87
|
52ba1996f1d8089f0101d189a5cdd27356206b1c |
|
07-May-2014 |
Mathieu Chartier <mathieuc@google.com> |
Fix spammy "Disabling background compaction for non zygote" message. Change-Id: I4abd85f75341ffc3cc38200d8b43a77b9b87c744
|
41961e2ad0aa064db9fefdd2a52368047961115a |
|
07-May-2014 |
Mathieu Chartier <mathieuc@google.com> |
Fix device booting with DlMalloc instead of RosAlloc. Change-Id: I347ef931e5c738937bcc50d7e8f4d5b3729fd3e4
|
e76e70f424468f311c2061c291e8384263f3968c |
|
03-May-2014 |
Mathieu Chartier <mathieuc@google.com> |
Add RecordFree to the GarbageCollector interface RecordFree now calls the Heap::RecordFree as well as updates the garbage collector's internal bytes freed accounting. Change-Id: I8cb03748b0768e3c8c50ea709572960e6e4ad219
|
89a201e599da95d88590c7b4d069b76735e20fa8 |
|
02-May-2014 |
Mathieu Chartier <mathieuc@google.com> |
Add GC cause to WaitForGcToComplete message. Change-Id: I8fe107d90a84de065c407b8d29fd106267ac440d
|
8668c3cbdcf9471bd97e0da68a240051f2973074 |
|
25-Apr-2014 |
Mathieu Chartier <mathieuc@google.com> |
Add finalizer references from the entrypoints. We now have an invariant where we never allocate finalizable objects with the Initialized or Resolved entrypoints. This speeds up allocation by only doing the check in the slow path. Before: MemAllocTest: 3625, 3707, 3641 EvaluateAndApplyChanges: 3448, 3421, 3413 After: MemAllocTest: 3164, 3109, 3135 EvaluateAndApplyChanges: 3272, 3299, 3353 Bug: 14078487 Change-Id: I2b0534af3e7c75ea5e5257cf3647744f7abfb74e
|
11d9f06a96a6909905c248ed684366190140095c |
|
23-Apr-2014 |
Narayan Kamath <narayan@google.com> |
Use instruction specific dalvik cache dirs. - All oat & art files are now placed under /data/dalvik-cache/<isa>/. - GetDalvikCacheOrDie now requires a mandatory subdirectory argument, and is implicitly rooted under /data/. - Added helper methods to convert InstructionSet enums into strings and vice versa. (cherry picked from commit 2974bc3d8a5d161d449dd66826d668d87bdc3cbe) Change-Id: Ic7986938e6a7091a2af675ebafec768f7b5fb8cd
|
1b54f9cb38605046d772ba0e125d5c009f1de7d2 |
|
01-May-2014 |
Mathieu Chartier <mathieuc@google.com> |
Clean up Add/Remove space. Deleted the set_as_default parameter and added a new function SetSpaceAsDefault instead. Change-Id: Ic4c359854d08e64ac0d0df92f0105447adb9df36
|
0651d41e41341fb2e9ef3ee41dc1f1bfc832dbbb |
|
29-Apr-2014 |
Mathieu Chartier <mathieuc@google.com> |
Add thread unsafe allocation methods to spaces. Used by SS/GSS collectors since these run with mutators suspended and only allocate from a single thread. Added AllocThreadUnsafe to BumpPointerSpace and RosAllocSpace. Added AllocThreadUnsafe which uses current runs as thread local runs for a thread unsafe allocation. Added code to revoke current runs which are the same idx as thread local runs. Changed: The number of thread local runs in each thread is now the the number of thread local runs in RosAlloc instead of the number of size brackets. Total GC time / time on EvaluateAndApplyChanges. TLAB SS: Before: 36.7s / 7254 After: 16.1s / 4837 TLAB GSS: Before: 6.9s / 3973 After: 5.7s / 3778 Bug: 8981901 Change-Id: Id1d264ade3799f431bf7ebbdcca6146aefbeb632
|
2974bc3d8a5d161d449dd66826d668d87bdc3cbe |
|
23-Apr-2014 |
Narayan Kamath <narayan@google.com> |
Use instruction specific dalvik cache dirs. - All oat & art files are now placed under /data/dalvik-cache/<isa>/. - GetDalvikCacheOrDie now requires a mandatory subdirectory argument, and is implicitly rooted under /data/. - Added helper methods to convert InstructionSet enums into strings and vice versa. Change-Id: I9bff2e2ca534e0b93842a50d5b272ddf6d5745f3
|
b0fa5dc7769c1e054032f39de0a3f6d6dd06f8cf |
|
29-Apr-2014 |
Ian Rogers <irogers@google.com> |
Force inlining on trivial accessors. Make volatility for GetFieldObject a template parameter. Move some trivial mirror::String routines to a -inl.h. Bug: 14285442 Change-Id: Ie23b11d4f18cb15a62c3bbb42837a8aaf6b68f92
|
6f365cc033654a5a3b45eaa1379d4b5f156b0cee |
|
23-Apr-2014 |
Mathieu Chartier <mathieuc@google.com> |
Enable concurrent sweeping for non-concurrent GC. Refactored the GarbageCollector to let all of the phases be run by the collector's RunPhases virtual method. This lets the GC decide which phases should be concurrent and reduces how much baked in GC logic resides in GarbageCollector. Enabled concurrent sweeping in the semi space and non concurrent mark sweep GCs. Changed the semi-space collector to have a swap semi spaces boolean which can be changed with a setter. Fixed tests to pass with GSS collector, there was an error related to the large object space limit. Before (EvaluateAndApplyChanges): GSS paused GC time 7.81s/7.81s, score: 3920 After (EvaluateAndApplyChanges): GSS paused GC time 6.94s/7.71s, score: 3900 Benchmark score doesn't go up since the GC happens in the allocating thread. There is a slight reduction in pause times experienced by other threads (0.8s total). Added options for pre sweeping GC heap verification and pre sweeping rosalloc verification. Bug: 14226004 Bug: 14250892 Bug: 14386356 Change-Id: Ib557d0590c1ed82a639d0f0281ba67cf8cae938c
|
62ab87bb3ff4830def25a1716f6785256c7eebca |
|
28-Apr-2014 |
Mathieu Chartier <mathieuc@google.com> |
Always log explicit GC. People who use DDMS want to see that a GC actually occurs when they press GC button. Bug: 14325353 Change-Id: I44e0450c92abf7223d33552ed37f626fe63e1c28
|
73d1e17b3afc7d5e56184f90bf819dc64956448a |
|
12-Apr-2014 |
Mathieu Chartier <mathieuc@google.com> |
Enable reading page map without lock in RosAlloc::BulkFree 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
|
3c4a43469046934e76082a4cf1aca14429cd9735 |
|
23-Apr-2014 |
Mathieu Chartier <mathieuc@google.com> |
Don't allow heap transitions if the runtime is shutting down. Bug: 14254222 Change-Id: I97ac988a96b56a8dc1eec018bf3ef7a691f04745
|
bbd695c71e0bf518f582e84524e1cdeb3de3896c |
|
16-Apr-2014 |
Mathieu Chartier <mathieuc@google.com> |
Replace ObjectSet with LargeObjectBitmap. 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
|
2f8da3e9ff60e5cb2a3fdf57dbcb67f513b9c2c2 |
|
16-Apr-2014 |
Mathieu Chartier <mathieuc@google.com> |
Decrease target utilization for foreground apps. 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
|
dcee9eeaa1d6ad80301c2ca52145259ab83abb2a |
|
15-Apr-2014 |
Mathieu Chartier <mathieuc@google.com> |
Less confusing heap transition message. 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
|
309e3bfc6a4c682ac09c95c596e11d8678603577 |
|
14-Apr-2014 |
Mathieu Chartier <mathieuc@google.com> |
Reduce bump pointer space capacity. Bug: 14058912 Change-Id: I7ae53e667539530d56ca2f5d10214e69c9c994e2
|
a8e8f9c0a8e259a807d7b99a148d14104c24209d |
|
09-Apr-2014 |
Mathieu Chartier <mathieuc@google.com> |
Refactor space bitmap to support different alignments. 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
|
7840888bd9b6accdb32c38563e78a9dc201f1303 |
|
12-Apr-2014 |
Mathieu Chartier <mathieuc@google.com> |
Fix hammerhead phone boot on master. Wasn't failing on AOSP. Change-Id: I8e531bf7493d36dc2667afeaf3133ce8560a2ce1
|
b272cd3013e046b7b001a091b0925b99a844e382 |
|
12-Apr-2014 |
Mathieu Chartier <mathieuc@google.com> |
Fix heap verification with SS/GSS. 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
|
d20aba14a3cb522e933800a164f7dc10eba21da3 |
|
12-Apr-2014 |
Hiroshi Yamauchi <yamauchi@google.com> |
Fix an occasional ThreadStress crash. 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
|
31f441464c0c8f840aba37e236ad133f30308d70 |
|
08-Apr-2014 |
Mathieu Chartier <mathieuc@google.com> |
Clean-up heap spaces. 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
|
b38d483b742eafc7833fac1ebb4fa1481cbac179 |
|
10-Apr-2014 |
Mathieu Chartier <mathieuc@google.com> |
Fix race condition in TransitionCollector. 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
|
b6898f55d27d40b60e1a4b0036ae809cc9123cee |
|
09-Apr-2014 |
Mathieu Chartier <mathieuc@google.com> |
Add mean GC duration to DumpGcPerformanceInfo. Change-Id: Ibd68e9d8cae71d0ceb769fc975f1148287e9ca4a
|
df86d1f8147a95c1ec2f0c5d85e0439ef7d71730 |
|
08-Apr-2014 |
Mathieu Chartier <mathieuc@google.com> |
Adjust sticky GC ergonomics. 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
|
df386c551405ce9668e827584f744c6f098761fa |
|
09-Apr-2014 |
Hiroshi Yamauchi <yamauchi@google.com> |
GSS: Fix the bump pointer space only collection. 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
|
5a48719b516a52d1a6800d8ae6f7dcba3d883bdc |
|
08-Apr-2014 |
Mathieu Chartier <mathieuc@google.com> |
Reset GC timings after SIGQUIT. 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
|
440e4ceb310349ee8eb569495bc04d3d7fbe71cb |
|
01-Apr-2014 |
Mathieu Chartier <mathieuc@google.com> |
Add monitor deflation. 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
|
da44d773dedf8aae6153e3423012f236cba3bfcd |
|
02-Apr-2014 |
Mathieu Chartier <mathieuc@google.com> |
Fix running with DlMalloc instead of RosAlloc. Bug: 13748830 Bug: 13744490 Change-Id: Ieec97cf58ebf9864a40ee85aae582cdcf3f27c0c
|
624468cd401cc1ac0dd70c746301e0788a597759 |
|
01-Apr-2014 |
Hiroshi Yamauchi <yamauchi@google.com> |
Make the support code for read barriers a bit more general. Add an option for Baker in addition to Brooks. Bug: 12687968 Change-Id: I8a31db817ff6686c72951b6534f588228e270b11
|
5ae2c9335a0c4eeaf4c67a52d066f16aad1aa907 |
|
29-Mar-2014 |
Mathieu Chartier <mathieuc@google.com> |
Fix non concurrent mark sweep ergonomics. 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
|
4aeec176eaf11fe03f342aadcbb79142230270ed |
|
28-Mar-2014 |
Mathieu Chartier <mathieuc@google.com> |
Refactor some GC code. Reduced amount of code in mark sweep / semi space by moving common logic to garbage_collector.cc. Cleaned up mod union tables and deleted an unused implementation. Change-Id: I4bcc6ba41afd96d230cfbaf4d6636f37c52e37ea
|
d5307ec41c8344be0c32273ec4f574064036187d |
|
28-Mar-2014 |
Hiroshi Yamauchi <yamauchi@google.com> |
An empty collector skeleton for a read barrier-based collector. Bug: 12687968 Change-Id: Ic2a3a7b9943ca64e7f60f4d6ed552a316ea4a6f3
|
afe4998fc15b8de093d6b282c9782d7182829e36 |
|
27-Mar-2014 |
Mathieu Chartier <mathieuc@google.com> |
Change sticky GC ergonomics to use GC throughput. The old sticky ergonomics used partial/full GC when the bytes until the footprint limit was < min free. This was suboptimal. The new sticky GC ergonomics do partial/full GC when the throughput of the current sticky GC iteration is <= mean throughput of the partial/full GC. Total GC time on FormulaEvaluationActions.EvaluateAndApplyChanges. Before: 26.4s After: 24.8s No benchmark score change measured. Bug: 8788501 Change-Id: I90000305e93fd492a8ef5a06ec9620d830eaf90d
|
0767c9a85a97e0e16c39a63c31de6c543304b0a4 |
|
26-Mar-2014 |
Mathieu Chartier <mathieuc@google.com> |
Add valgrind support to large object map space. Added valgrind support to large object map space. Bug: 7392044 Change-Id: I1456f46414e1fa59ebcc2190ec00576dae26d623
|
91e3063d97b4dba239682d00ecfb3ea8c0a96539 |
|
25-Mar-2014 |
Mathieu Chartier <mathieuc@google.com> |
Add GC mode for stressing testing heap transitions. The stress testing mode does repeated heap transitions when the heap gets a process state update. In between each transition, the heap waits for a specified number of time. Change-Id: Ie3f43835e539fa8da147f77b4623a432a0d858c2
|
3b05e9ba874449dbff65b01b8781001f7d93eea6 |
|
25-Mar-2014 |
Mathieu Chartier <mathieuc@google.com> |
Add missing debugger root visiting. Bug: 13634574 Change-Id: I2a76f6c43f1d0ad1922f06deb40a71ff651129fd
|
407f702da4f867c074fc3c8c688b8f8c32279eff |
|
18-Feb-2014 |
Mathieu Chartier <mathieuc@google.com> |
Refactor object reference visiting logic. Refactored the reference visiting logic to be in mirror::Object instead of MarkSweep. Change-Id: I773249478dc463d83b465e85c2402320488577c0
|
0e54cd0d8fc635d3dc8bf88a465fdade151a098f |
|
20-Mar-2014 |
Mathieu Chartier <mathieuc@google.com> |
Refactor and optimize GC code. Fixed the reference cache mod union table, and re-enabled it by default. Added a boolean flag to count how many null objects, immune, fast path, slow path objects we marked. Slight speedup in mark stack processing, large speedup in image mod union table scanning. EvaluateAndApplyChanges Before: Process mark stack time for full GC only: 12.464089s, 12.357870s, 12.538028s Time spent marking mod image union table ~240ms. After: Process mark stack time: 12.299375s, 12.217142s, 12.187076s Time spent marking mod image union table ~40ms. TODO: Refactor reference visiting logic into mirror::Object. Change-Id: I91889ded9d3f2bf127bc0051c1b1ff77e792e94f
|
c93c530efc175954160c3834c93961a1a946a35a |
|
21-Mar-2014 |
Hiroshi Yamauchi <yamauchi@google.com> |
Revoke rosalloc thread-local buffers at the checkpoint. In the mark sweep collector, rosalloc thread-local buffers were revoked during the pause. Now, they are revoked at the thread checkpoint, as opposed to during the pause, which appears to help reduce the pause time. In Ritz MemAllocTest, the average sticky pause time went down ~20% (925 us -> 724 us). Bug: 13394464 Bug: 9986565 Change-Id: I104992a11b46d59264c0b9aa2db82b1ccf2826bc
|
601276abdb746b03675ff945745aa936694d3439 |
|
20-Mar-2014 |
Mathieu Chartier <mathieuc@google.com> |
Fix RecordFree to take signed parameters. RecordFree can get negative bytes allocated when background compaction foreground transitions occur. This caused a DCHECK to fail on debug builds. Also did some refactoring in PreProcessReferences. Bug: 13568814 Change-Id: I57543f1c78544a94f1d241459698b736dba8cfa8
|
3e41780cb3bcade3b724908e00443a9caf6977ef |
|
20-Mar-2014 |
Hiroshi Yamauchi <yamauchi@google.com> |
Refactor the garbage collector driver (GarbageCollector::Run). Bug: 12687968 Change-Id: Ifc9ee86249f7938f51495ea1498cf0f7853a27e8
|
1ad2784ad9f311ebf9fe0677d33818648f423f9c |
|
20-Mar-2014 |
Mathieu Chartier <mathieuc@google.com> |
Add soft reference pre processing. Soft reference pre-processing does soft reference preservation with mutators running. After this is done, it does another pass with mutators paused in the ProcessReference code. This helps lower pauses since most preserved soft references have their referents recursive marked outside the pause. Changed ergonomics to have non sticky collectors always clear the soft references. Maps pauses ~10ms -> ~3ms on Nexus 4. Bug: 13421927 Change-Id: I1370f7bb6934034869aa5afca0c377876267aa8e
|
38e68e9978236db87c9008bbe47db80525d2fa16 |
|
07-Mar-2014 |
Hiroshi Yamauchi <yamauchi@google.com> |
Use the card table to speed up the GSS collector. Scan only dirty cards, as opposed to the whole space, to find references from the non-moving spaces to the bump pointer spaces at bump pointer space only collections. With this change, the Ritz MemAllocTest speeds up by 8-10% on host and 2-3% on N4. The Ritz EvaluateFibonacci speeds up by 8% and its average pause time is reduced by 43% on N4. Bug: 11650816 Change-Id: I1eefe75776bc37e24673b301ffa65a25f9bd4cde
|
53b8b09fc80329539585dcf43657bc5f4ecefdff |
|
14-Mar-2014 |
Ian Rogers <irogers@google.com> |
Refactor reflective method invocation. Move invocation code out of JNI internal into reflection, including ArgArray code. Make reflective invocation use the ArgArray to build arguments rather than allocating a jvalue[] and unboxing arguments into that. Move reflection part of jni_internal_test into reflection_test. Make greater use of fast JNI. Change-Id: Ib381372df5f9a83679e30e7275de24fa0e6b1057
|
8fa2dad7fe7909c8335101d6c8904ae997cdf29f |
|
13-Mar-2014 |
Mathieu Chartier <mathieuc@google.com> |
Refactor reference code into mirror namespace. Added two new files: mirror/reference.h and mirror/reference-inl.h. Change-Id: Ibe3ff6379aef7096ff130594535b7f7c0b7dabce
|
7bf52d28978a6a747795cc0c78b04a3e83f0cf16 |
|
13-Mar-2014 |
Mathieu Chartier <mathieuc@google.com> |
Fix heap trimming logic. The new heap trimming logic introduced in the c/84301 was not very good since the heap trim would get avoided since the daemon thread was coming to the heap trimming code before the scheduled time. The new logic is to do the heap trim if the last heap trim occurred more than kHeapTrimWait ns ago. Change-Id: I9d0e6766bf0c68e5f7fb15fb059140e1f1264216
|
5ccd498d4aa450b0381344724b072a932709a59a |
|
11-Mar-2014 |
Hiroshi Yamauchi <yamauchi@google.com> |
Put the post zygote non-moving space next to the malloc space. This change fixes the following problem with the GSS collector: if the post zygote non-moving space happens to be located after the bump pointer spaces, the bump pointer space is treated wrongfully as an immune space. The reasons are 1) the immune space is represented by a simple address range and 2) the GSS collector treats the post zygote non-moving space as an immune space at a bump pointer space only collection. In addition, this change makes it a reality that all the non-moving spaces are adjacent, which we tend to assume in the code (eg. the notion of the immune space represented by a simple address range.) This should help avoid potential confusions in the future. Fix a DCHECK failure where usable_size isn't set properly when -XX:UseTLAB is used. Change-Id: I585920e433744a390f87e9a25bef6114b2a4623f
|
c645f1ddb7c40bea6a38eda4b3f83f6b6dec405b |
|
07-Mar-2014 |
Mathieu Chartier <mathieuc@google.com> |
Add more VerifyObject calls. Added verify object calls to SirtRef, IndirectReferenceTable, ReferenceTable. Removed un-needed verify object in ScopedObjectAccess / DecodeJObject since object sources are handled. Bug: 12934910 Change-Id: I55a46a8ea61fed2a77526eda27fd2cce97a9b125
|
a5f9de040a7a740b7b4979bc8d47f95eb05718ae |
|
01-Mar-2014 |
Mathieu Chartier <mathieuc@google.com> |
Defer heap transitions to heap trimming daemon. This fixes the case where quick back and forth process state changes would cause a lot of heap transitions. Change-Id: Ia5be792edcf26079b2aa23b9c115f6b0a9a39a1c
|
6dda898d47b3e8931e4404330e81b7110108e34f |
|
06-Mar-2014 |
Mathieu Chartier <mathieuc@google.com> |
Disable compaction for jni workarounds. Compaction can't work when jni workarounds is enabled. Also some other refactoring. Change-Id: Ia7b0f2b39c79f5a0a5f50874d823b950ab02a0c3
|
661974a5561e5ccdfbac8cb5d8df8b7e6f3483b8 |
|
09-Jan-2014 |
Mathieu Chartier <mathieuc@google.com> |
Fix valgrind gtests and memory leaks. All tests pass other than image_test which passes if some bad reads are disabled (buzbee working on this). Change-Id: Ifd6b6e3aed0bc867703b6e818353a9f296609422
|
893263b7d5bc2ca43a91ecb8071867f5134fc60a |
|
04-Mar-2014 |
Mathieu Chartier <mathieuc@google.com> |
Avoid marking old class linker and intern table roots during pause. The new root visiting logic has a concept of a root log which holds new roots which were added since the start of the GC. This is an optimization since it lets us only mark these newly added roots during the pause (or pre-cleaning) since the other roots intern table and class linker roots were marked concurrently at the start of the GC. Before (EvaluateAndApplyChanges): MarkConcurrentRoots: Sum: 605.193ms After: MarkConcurrentRoots: Sum: 271.858ms This should also reduce pathological GC pauses which used to be able to happen when the intern table or class linker became "dirty" during the concurrent GC. Change-Id: I433fab021f2c339d50c35aaae7161a50a0901dec
|
d889178ec78930538d9d6a66c3df9ee9afaffbb4 |
|
02-Mar-2014 |
Mathieu Chartier <mathieuc@google.com> |
Guard entrypoint changing by runtime shutdown lock. There was a race when we changed the allocation entrypoints where a new thread would be starting (Thread::Init) and initialize to the wrong entrypoints. Guarding allocation entrypoint changing with the runtime shutdown lock fixes this race condition since Thread::Init is only called with the runtime shutdown lock held. Bug: 13250963 Change-Id: I8eb209c124b6bf17020de874e1b0083f158b8200
|
c2f4d0240b3a9b905dff5b546924865f15241481 |
|
04-Mar-2014 |
Mathieu Chartier <mathieuc@google.com> |
Fix SafePrettyTypeOf to never call VerifyObject. Calling VerifyObject from the segfault handler caused another segfault. Change-Id: I459646594d830cbb110a4ac2bac25a7b90794854
|
15d3402bbf8265eb1165694da2e4117eb128f3bc |
|
27-Feb-2014 |
Mathieu Chartier <mathieuc@google.com> |
Add custom SIGSEGV handler to help find heap corruption. The new signal handler prints heap diagnostics when you get a SIGSEGV. Added a fault message member in runtime which is modifiable by Runtime::SetFaultMessage. When you get a SIGSEGV it will print out whatever is stored in this string as well as the normal information. This is useful for debugging heap corruption since it lets you see which threads were in which methods when the last GC occured. Added some smarter object dumping logic when the faulting address is in the heap. Bug: 12934910 Change-Id: Ia72be2c39f70ad711cbd746d66fad2b617d5d29f
|
bd0a65339a08dc28c6b56d2673f1f13b6bddd7aa |
|
27-Feb-2014 |
Mathieu Chartier <mathieuc@google.com> |
Enable large object space for command line runs. Added a dynamic large_object_threshold_ variable which is max int when the large object space is disabled. No longer clear timing logger timings after zygote creation since it is not required and removes the boot semispace timings. Change-Id: I693865f4699cc32381199377239854c6ec42f37e
|
6fac447555dc94a935b78198479cce645c837b89 |
|
26-Feb-2014 |
Ian Rogers <irogers@google.com> |
Make allocations report usable size. Work-in-progress to allow arrays to fill usable size. Bug: 13028925. Use C++11's override keyword on GCC >= 2.7 to ensure that we override GC and allocator methods. Move initial mirror::Class set up into a Functor so that all allocated objects have non-zero sizes. Use this property to assert that all objects are never larger than their usable size. Other bits of GC related clean-up, missing initialization, missing use of const, hot methods in .cc files, "unimplemented" functions that fail at runtime in header files, reducing header file includes, move valgrind's space into its own files, reduce number of array allocation routines. Change-Id: Id5760041a2d7f94dcaf17ec760f6095ec75dadaa
|
9d04a20bde1b1855cefc64aebc1a44e253b1a13b |
|
31-Jan-2014 |
Hiroshi Yamauchi <yamauchi@google.com> |
(Experimental) Add Brooks pointers. This feature is disabled by default. Verified that the Brooks pointers are installed correctly by using the CMS/SS collectors. Change-Id: Ia9be9814ab6e29169ac85edc4792ce8c81d552a9
|
c22c59ef8513b4cbbfd25073d1afbf58196b522a |
|
25-Feb-2014 |
Mathieu Chartier <mathieuc@google.com> |
Remove started runtime check in RevokeAllThreadLocalAllocationStacks This check occasionally caused some thread local allocation stacks to incorrectly not get revoked when multiple threads were allocating without a started runtime. This showed up in image_test with compaction enabled when we were initializing classes in the compiler driver. Change-Id: I7f28d072feea333c2503e35265ba25c51a6308fe
|
4e30541a92381fb280cd0be9a1763b713ee4d64c |
|
19-Feb-2014 |
Mathieu Chartier <mathieuc@google.com> |
Fix and optimize verify object. VerifyObject no longer resides in heap. You can now enable VerifyObject for non-debug builds. VerifyStack is still slow, so it is now guarded by its own flag. Fixed the image writer to not use verification at places where verification fails due to invalid reads. Fixed RosAlloc to use SizeOf which doesn't call verify object. Added a flag paremeter to some of the mirror getters / setters to be able to selectively disable VerifyObject on certain calls. Optimized the GC to not verify each object multiple times during object scanning if verify object is enabled. Added 3 verification options: verify reads, verify this, and verify writes so that you can select how much verification you want for mirror getters and setters. Removed some useless DCHECKs which would slow debug builds without providing any benefits. TODO: RosAlloc verification doesn't currently work with verify objects. Bug: 12934910 Bug: 12879358 Change-Id: Ic61033104dfc334543f89b0fc0ad8cd4f4015d69
|
3bb57c7b41bf5419fe895e7aa664d8d430205ba8 |
|
18-Feb-2014 |
Mathieu Chartier <mathieuc@google.com> |
Change ProcessReferences to not use RecursiveMarkObject. Calling ProcessMarkStack in RecursiveMarkObject caused a lot of overhead due to timing logger splits. Changed the logic to be the same as prior to the reference queue refactoring which involves calling process mark stack after preserving soft references and enqueueing finalizer references. FinalizingGC longest pause is reduced by around 1/2 down to ~300ms. Benchmark score ~400000 -> ~600000. Also changed the timing logger splits in the GC to have (Paused) if the split is a paused part of the GC. Bug: 12129382 Change-Id: I7476d4f23670b19d70738e2fd48e37ec2f57e9f4
|
815873ecc312b1d231acce71e1a16f42cdaf09f2 |
|
14-Feb-2014 |
Mathieu Chartier <mathieuc@google.com> |
Change root visitor to use Object**. Simplifies code and improves the performance of root visiting since we usually don't need to check to see if the object moved. Change-Id: Iba998f5a15ae1fa1b53ca5226dd2168a411196cf
|
d2fe10a3a34af171bf1631219cd2d6ff6b7778b5 |
|
15-Jan-2014 |
Sebastien Hertz <shertz@google.com> |
Remove blacklist Removes the class initialization blacklist and use transaction to detect and revert class initialization attempting to invoke native method. This only concerns class initialization happening at compilation time when generating an image (like boot.art for the system). In transactional mode, we log every object's field assignment and array update. Therefore we're able to abort a transaction to restore values of fields and array as they were before the transaction starts. We also log changes to the intern string table so we can restore its state prior to transaction start. Since transactional mode only happens at compilation time, we don't need to log all these changes at runtime. In order to reduce the overhead of testing if transactional mode is on/off, we templatize interfaces of mirror::Object and mirror::Array, respectively responsible for setting a field and setting an array element. For various reasons, we skip some specific fields from transaction: - Object's class and array's length must remain unchanged so garbage collector can compute object's size. - Immutable fields only set during class loading: list of fields, method, dex caches, vtables, ... as all classes have been loaded and verified before a transaction occurs. - Object's monitor for performance reason. Before generating the image, we browse the heap to collect objects that need to be written into it. Since the heap may still holds references to unreachable objects due to aborted transactions, we trigger one collection at the end of the class preinitialization phase. Since the transaction is held by the runtime and all compilation threads share the same runtime, we need to ensure only one compilation thread has exclusive access to the runtime. To workaround this issue, we force class initialization phase to run with only one thread. Note this is only done when generating image so application compilation is not impacted. This issue will be addressed in a separate CL. Bug: 9676614 Change-Id: I221910a9183a5ba6c2b99a277f5a5a68bc69b5f9
|
1ed9061e5912ebea7d4639ee2926d273300606a1 |
|
15-Feb-2014 |
Hiroshi Yamauchi <yamauchi@google.com> |
Fix preverify. The thread-local allocation stack change: https://android-review.googlesource.com/82056 broke preverify. This change fixes it. Change-Id: I2625e47d48d0fd48dff6c9210be6ebffe7a5f233
|
f5b0e20b5b31f5f5465784adcf2a204dcd69c7fd |
|
12-Feb-2014 |
Hiroshi Yamauchi <yamauchi@google.com> |
Thread-local allocation stack. With this change, Ritz MemAllocTest gets ~14% faster on N4. Bug: 9986565 Change-Id: I2fb7d6f7c5daa63dd4fc73ba739e6ae4ed820617
|
be77b7a77e5a6391f9ad128ad302bae266c0730e |
|
13-Feb-2014 |
Mathieu Chartier <mathieuc@google.com> |
Merge "Prevent object allocation related races in VisitObjects."
|
ebdf3f320d71563cf0236c31d35d633be9576d8c |
|
13-Feb-2014 |
Mathieu Chartier <mathieuc@google.com> |
Prevent object allocation related races in VisitObjects. Prevents the following race conditions: Someone is in the process of pushing a reference in the allocation stack but hasn't yet written the reference. This caused VisitObjects to occasionally send null objects to the visitor. Fixed another race where the object had just been allocated but the class had not been written. We now skip objects in the allocation stack which have a null class. Bug: 13004631 Change-Id: Iad789c5e277a7717ce595c7124f0d65b44392fd8
|
0177e53ea521ad58b70c305700dab32f1ac773b7 |
|
12-Feb-2014 |
Ian Rogers <irogers@google.com> |
Work in the direction of hard float quick ABIs. Pass a shorty to ArtMethod::Invoke so that register setup can use it. Document x86-64 ABI. Add extra debug output for one JNI native method registration fails, namely a dump of the Class and its dex file's location. Add hack to get testing of OatMethod's without GC maps working in 64bit. Change-Id: Ic06b68e18eac33637df2caf5e7e775ff95ae70f3
|
d68ac700820f3e4253c8b4bcf718daf452f6da4c |
|
11-Feb-2014 |
Mathieu Chartier <mathieuc@google.com> |
Add more checking to ReleasePrimitiveArray. When we ReleasePrimitiveArray, we now check that the elements pointer is not a heap address if it is not equal to the java array's data. Bug: 12845603 Change-Id: I458862f4dc586ba1c414647c7eb81b978c4ccb7e
|
83c8ee000d525017ead8753fce6bc1020249b96a |
|
28-Jan-2014 |
Mathieu Chartier <mathieuc@google.com> |
Add root types and thread id to root visiting. Enables us to pass the root type and thread id to hprof. Bug: 12680863 Change-Id: I6a0f1f9e3aa8f9b4033d695818ae7ca3460d67cb
|
412c7fced915fc8d4d5e4166e977d55c809168a6 |
|
07-Feb-2014 |
Mathieu Chartier <mathieuc@google.com> |
Make debugger / jdwp compaction safe. Fixed GetInstances, GetReferringObjects, CountInstances to use VisitObjects instead of the live bitmap. We now treat the object registry as system weaks and update the objects when/if they move. Also added the recent_allocation_records_ as roots. Bug: 12936165 Change-Id: I615c289efbf2977ceab5c4ffa73d216d799e6e33
|
a4adbfd44032d70e166e6f18096bbbed05a990ba |
|
05-Feb-2014 |
Hiroshi Yamauchi <yamauchi@google.com> |
RosAlloc verification. If enabled, RosAlloc verification checks the allocator internal metadata and invariants to detect bugs, heap corruptions, and race conditions. Added runtime options for enabling and disabling it. Enable it for the debug build. Bug: 9986565 Bug: 12592026 Change-Id: I923742b87805ae839f1549d78d0d492733da6a58
|
ef7d42fca18c16fbaf103822ad16f23246e2905d |
|
06-Jan-2014 |
Ian Rogers <irogers@google.com> |
Object model changes to support 64bit. Modify mirror objects so that references between them use an ObjectReference value type rather than an Object* so that functionality to compress larger references can be captured in the ObjectRefererence implementation. ObjectReferences are 32bit and all other aspects of object layout remain as they are currently. Expand fields in objects holding pointers so they can hold 64bit pointers. Its expected the size of these will come down by improving where we hold compiler meta-data. Stub out x86_64 architecture specific runtime implementation. Modify OutputStream so that reads and writes are of unsigned quantities. Make the use of portable or quick code more explicit. Templatize AtomicInteger to support more than just int32_t as a type. Add missing, and fix issues relating to, missing annotalysis information on the mutator lock. Refactor and share implementations for array copy between System and uses elsewhere in the runtime. Fix numerous 64bit build issues. Change-Id: I1a5694c251a42c9eff71084dfdd4b51fff716822
|
1f3b5358b28a83f0929bdd8ce738f06908677fb7 |
|
03-Feb-2014 |
Mathieu Chartier <mathieuc@google.com> |
Move SwapBitmaps to ContinuousMemMapAllocSpace. Moved the SwapBitmaps function to ContinuousMemMapAllocSpace since the zygote space uses this function during full GC. Fixed a place where we were casting a ZygoteSpace to a MallocSpace, somehow this didn't cause any issues in non-debug builds. Moved the CollectGarbage in PreZygoteFork before the lock to prevent an occasional lock level violation caused by attempting to enqueue java lang references with the a lock. Bug: 12876255 Change-Id: I77439e46d5b26b37724bdcee3a0948410f1b0eb4
|
caa82d61b73d2d426ac1666e9186d7825000a849 |
|
03-Feb-2014 |
Mathieu Chartier <mathieuc@google.com> |
Fix lock order checking violation. Turns out you can't do thread state changes while holding locks. This change fixes occasional lock violations in ThreadStress test. Also moved the usleep in TransitionCollector outside of the place we hold the gc_complete_lock_. Change-Id: Ib3a85fffdbea80b64d72a2ad7e916251340c22e6
|
d5a89ee74c00bd24a34b6e795828a0b86842630f |
|
31-Jan-2014 |
Mathieu Chartier <mathieuc@google.com> |
Fix race conditions caused by StartGC. Race1: Heap trimming could happen when we were transitioning the heap. This caused the space to get deleted in the middle of the trim. Race2: IncrementDisableCompactingGC needed to WaitForConcurrentGC if we were running a moving GC or about to starting a moving GC. Race3: The logic for whether or not we had a compacting GC was calculated before StartGC in CollectGarbageInternal. This could cause us to get blocked waiting for the GC to complete and come out of the wait with a new collector_type_ due to a heap transition. Change-Id: I07c36ae5df1820e9cca70cf239e46175c1eb9575
|
a1602f28c0e3127ad511712d4b08db89737ae901 |
|
14-Jan-2014 |
Mathieu Chartier <mathieuc@google.com> |
Add zygote space as its own space type. Helps prevent errors caused from doing invalid operations on the old alloc space. Removed some duplicated code in mark_sweep.cc and semi_space.cc. Change-Id: I67a772cab30d698744c918aad581053f282a4a99
|
1d27b34d3b18a5a0c832dae9768366dc08ef8d1c |
|
28-Jan-2014 |
Mathieu Chartier <mathieuc@google.com> |
Change DisableGC to DisableMovingGC. Also removed the WaitForConcurrentGC in IncrementDisableMovingGC since we do not currently support any type of concurrent moving collectors. This fixes the performance regression introduced by waiting for the concurrent GC which manifested itself in framework perf benchmarks as a result of background compaction. Change-Id: I524f9ab52e1992419626a27649f232ca6967b03d
|
9be9a7a344096e040f2edfbdf8e479634058a2d7 |
|
24-Jan-2014 |
Mathieu Chartier <mathieuc@google.com> |
Improve IsMovableObject logic. The new logic says the main space is non movable iff neither the background collector or foreground collector are compacting. Temporarily fixes performance regressions and stability issues caused by buggy JNI code. Also addressed a few review comments from previous CLs. Change-Id: Id5f91765b5fbdae387b566c0bda3392557218ba1
|
7476280b20d0b5addf9e4a2ce84d1eee36c76c1e |
|
24-Jan-2014 |
Mathieu Chartier <mathieuc@google.com> |
Change GC ergonomics to better handle heap verification. Added a new constant kMaxConcurrentRemainingBytes which put a lower bound on the background GC watermark. This fixes a performance issue caused by heap verification being really slow and making it that we were excessively scheduling back to back GCs. Greatly increases system/test performance when heap verification is enabled. Change-Id: I68fa5a247c42f6c661e313c49dd3ca6be29951d4
|
938a03b3f196895e1fce2b862ae01039deca4c34 |
|
17-Jan-2014 |
Mathieu Chartier <mathieuc@google.com> |
Fix heap verification and add runtime options. Post GC heap verification is now enabled by default for debug builds. Added four Xgc runtime options: preverify, nopreverify, postverify, nopostverify. Fixed another bug where the non-moving space could theoretically end up outside of the card table address range. Bug: 10672951 Change-Id: I5ba3cd96dbfb900263dba795242df74c563deaa3
|
6f4ffe41649f1e6381e8cda087ad3749206806e5 |
|
13-Jan-2014 |
Hiroshi Yamauchi <yamauchi@google.com> |
Improve the generational mode. - Turn the compile-time flags for generational mode into a command line flag. - In the generational mode, always collect the whole heap, as opposed to the bump pointer space only, if a collection is an explicit, native allocation-triggered or last attempt one. Change-Id: I7a14a707cc47e6e3aa4a3292db62533409f17563
|
e01b5406a93293f5abf6a61d4fec34f2becd47ca |
|
13-Jan-2014 |
Mathieu Chartier <mathieuc@google.com> |
Remove zygote space from alloc_spaces_ array. Not removing this space was causing a crash in Heap::GetObjectsAllocated since the new zygote bin packing places objects where the normal DlMalloc/RosAlloc accounting would be. Going to refactor zygote spaces to be a new space type in the near future to avoid more of these types of issues. Bug: 12490061 Change-Id: Id4f75d0315c63e0e8c19f6fba9ad9cb2ba9017e5
|
05e713a3a009a0825826ce6d494582fcd6dd6a8d |
|
09-Jan-2014 |
Hiroshi Yamauchi <yamauchi@google.com> |
Bump pointer space only collection. Add a mode of collection that collects only the bump pointer spaces, as opposed to the whole heap. It's disabled behind a flag. TODO: It still scans the entire non-moving space to look for inter-space references. Use a card table like technique to limit the scope of scanning and speed it up. Bug: 11650816 Change-Id: I56cb11e78e47a578bff644e6e6c63d978cfedf39
|
db7f37d57b6ac83abe6815d0cd5c50701b6be821 |
|
10-Jan-2014 |
Mathieu Chartier <mathieuc@google.com> |
Refactor large object sweeping. Moved basic sweeping logic into large_object_space.cc. Renamed SpaceSetMap -> ObjectSet. Change-Id: I938c1f29f69b0682350347da2bd5de021c0e0224
|
5dc08a680696554ffc76d58dd591b23e79f5b5a1 |
|
10-Jan-2014 |
Mathieu Chartier <mathieuc@google.com> |
Fix ART debug build boot. Some of the checks were no longer valid after the zygote bin packing. Bug: 12480317 Change-Id: Iaa169b0aafe9fec06e75e9b58a3de28aa70a9421
|
a4b95a2793c9840ae5e273e4499d8765438e4a2d |
|
10-Jan-2014 |
Mathieu Chartier <mathieuc@google.com> |
Fix RemoveSpace memory leak. RemoveSpace now deletes the input space. This fixes a memory leak related to background compaction. Change-Id: I7123297adb475b1045f7d1a42d595c53daad0faa
|
fc5b528fc46ccff655cfb3578847350f74064e8d |
|
10-Jan-2014 |
Mathieu Chartier <mathieuc@google.com> |
Fix IsMovableObject to handle background compaction. Before we assumed that only the bump pointer space contained movable objects. This is incorrect since the background compaction foreground -> background transition copies objects from the RosAlloc / DlMalloc space (now called main space) to the bump pointer space. Bug: 8981901 Change-Id: Ie7bb9a5d82012988573e944ede2f6a8a77d8872f
|
85a43c055fcdc366293c61df6f65e586d6967841 |
|
08-Jan-2014 |
Mathieu Chartier <mathieuc@google.com> |
Bin packing the zygote (best fit). We now use bin packing to fill holes in the non movable space with objects from the bump pointer space when we create the zygote. Zygote space PSS reduction on AOSP: ~300k. Zygote size on AOSP: 2121040 bytes -> 1597944 bytes. Deleted some unreachable code. Bug: 11902311 Change-Id: Idc957d69e93b3a941e0c298d47a21b73526dd286
|
e6da9af8dfe0a3e3fbc2be700554f6478380e7b9 |
|
16-Dec-2013 |
Mathieu Chartier <mathieuc@google.com> |
Background compaction support. When the process state changes to a state which does not perceives jank, we copy from the main free-list backed allocation space to the bump pointer space and enable the semispace allocator. When we transition back to foreground, we copy back to a free-list backed space. Create a seperate non-moving space which only holds non-movable objects. This enables us to quickly wipe the current alloc space (DlMalloc / RosAlloc) when we transition to background. Added multiple alloc space support to the sticky mark sweep GC. Added a -XX:BackgroundGC option which lets you specify which GC to use for background apps. Passing in -XX:BackgroundGC=SS makes the heap compact the heap for apps which do not perceive jank. Results: Simple background foreground test: 0. Reboot phone, unlock. 1. Open browser, click on home. 2. Open calculator, click on home. 3. Open calendar, click on home. 4. Open camera, click on home. 5. Open clock, click on home. 6. adb shell dumpsys meminfo PSS Normal ART: Sample 1: 88468 kB: Dalvik 3188 kB: Dalvik Other Sample 2: 81125 kB: Dalvik 3080 kB: Dalvik Other PSS Dalvik: Total PSS by category: Sample 1: 81033 kB: Dalvik 27787 kB: Dalvik Other Sample 2: 81901 kB: Dalvik 28869 kB: Dalvik Other PSS ART + Background Compaction: Sample 1: 71014 kB: Dalvik 1412 kB: Dalvik Other Sample 2: 73859 kB: Dalvik 1400 kB: Dalvik Other Dalvik other reduction can be explained by less deep allocation stacks / less live bitmaps / less dirty cards. TODO improvements: Recycle mem-maps which are unused in the current state. Not hardcode 64 MB capacity of non movable space (avoid returning linear alloc nightmares). Figure out ways to deal with low virtual address memory problems. Bug: 8981901 Change-Id: Ib235d03f45548ffc08a06b8ae57bf5bada49d6f3
|
b122a4bbed34ab22b4c1541ee25e5cf22f12a926 |
|
20-Nov-2013 |
Ian Rogers <irogers@google.com> |
Tidy up memory barriers. Change-Id: I937ea93e6df1835ecfe2d4bb7d84c24fe7fc097b
|
573f7d2d68e1838a0485e6b40d90c967526e00c2 |
|
17-Dec-2013 |
Hiroshi Yamauchi <yamauchi@google.com> |
Fix an array copy benchmark regression. Add different page release modes to rosalloc. Bug: 12064551 Change-Id: Ib837bbd1a2757741a4e2743e0a1272bf46a30252
|
692fafd9778141fa6ef0048c9569abd7ee0253bf |
|
30-Nov-2013 |
Mathieu Chartier <mathieuc@google.com> |
Thread local bump pointer allocator. Added a thread local allocator to the heap, each thread has three pointers which specify the thread local buffer: start, cur, and end. When the remaining space in the thread local buffer isn't large enough for the allocation, the allocator allocates a new thread local buffer using the bump pointer allocator. The bump pointer space had to be modified to accomodate thread local buffers. These buffers are called "blocks", where a block is a buffer which contains a set of adjacent objects. Blocks aren't necessarily full and may have wasted memory towards the end. Blocks have an 8 byte header which specifies their size and is required for traversing bump pointer spaces. Memory usage is in between full bump pointer and ROSAlloc since madvised memory limits wasted ram to an average of 1/2 page per block. Added a runtime option -XX:UseTLAB which specifies whether or not to use the thread local allocator. Its a NOP if the garbage collector is not the semispace collector. TODO: Smarter block accounting to prevent us reading objects until we either hit the end of the block or GetClass() == null which signifies that the block isn't 100% full. This would provide a slight speedup to BumpPointerSpace::Walk. Timings: -XX:HeapMinFree=4m -XX:HeapMaxFree=8m -Xmx48m ritzperf memalloc: Dalvik -Xgc:concurrent: 11678 Dalvik -Xgc:noconcurrent: 6697 -Xgc:MS: 5978 -Xgc:SS: 4271 -Xgc:CMS: 4150 -Xgc:SS -XX:UseTLAB: 3255 Bug: 9986565 Bug: 12042213 Change-Id: Ib7e1d4b199a8199f3b1de94b0a7b6e1730689cad
|
c528dba35b5faece51ca658fc008b688f8b690ad |
|
26-Nov-2013 |
Mathieu Chartier <mathieuc@google.com> |
Enable moving classes. Slight reduction in Zygote size, memory savings are in the noise. Before: Zygote size: 8739224 After: Zygote size: 8733568 Fixed a bug where we didn't set the concurrent start bytes after switching the allocator from bump pointer to ROSAlloc in the zygote. This caused excessive memory usage. Added the method verifiers as roots to fix an issue caused by RegTypes holding a Class*. Added logic to clear card table in the SemiSpace collector, this reduces DalvikOther from ~2400k -> ~1760k when using the SemiSpace collector. Added a missing lock to the timing loggers which caused a rare one time crash in std::set. Bug: 11771255 Bug: 8499494 Bug: 10802951 Change-Id: I99d2b528cd51c1c5ed7012e3220b3aefded680ae
|
7bf82af01ec250a4ed2cee03a0e51d179fa820f9 |
|
07-Dec-2013 |
Mathieu Chartier <mathieuc@google.com> |
Fix memory usage regression and clean up collector changing code. Memory usage regressed since we didn't properly update concurrent_start_bytes_ when changing collectors. Bug: 12034247 Change-Id: I1c69e71cd2919e0d3bf75485a4ac0b0aeca59278
|
ca2a24da53869a04e1947aa46d06ccce5247d6f4 |
|
26-Nov-2013 |
Mathieu Chartier <mathieuc@google.com> |
Add interface for updating process state. Called from activity manager to let the heap know when it should perform compaction and trimming. Bug: 8981901 Change-Id: Ib8ea48d2dc9d6901c3f2e0554391721d6691e726
|
7410f29b4dae223befac036ea567d7f33351dad1 |
|
24-Nov-2013 |
Mathieu Chartier <mathieuc@google.com> |
Fix dumpsys meminfo <pid>. Added a case for BumpPointerSpaces. Confirmed working non-debug. Should also work in debug builds. Bug: 11830794 Change-Id: I12053ff16eec403dcd4a780e13095e3212a77132
|
0de9f73afe3e835b63f2ee0c1416930656449f3f |
|
23-Nov-2013 |
Mathieu Chartier <mathieuc@google.com> |
Add -xGc: MS, CMS, SS options to specify which GC to use. Can be used for running tests or benchmarks with semispace, marksweep or concurrent marksweep. Change-Id: Ic9ab1220150f2c7c9c30df4ffee45b9d303094b3
|
2e899a92439dc6bdaaa67b8230933006284aa600 |
|
23-Nov-2013 |
Hiroshi Yamauchi <yamauchi@google.com> |
Fix a crash with -XX:DumpGCPerformanceOnShutdown. DumpGcPerformanceInfo() could call RosAllocSpace::InspectAllRosAlloc() which needs the thread list to be still alive. Fix by moving the DumpGcPerformanceInfo() call from the Heap destructor up to the beginning of the Runtime destructor so that the thread list is still alive when it's called. Bug: 11830901 Change-Id: Ib094d60916943c8cb1d4b769d805b4ca03269f90
|
ff3b24aa929a9db79daeef7c0b0522da099700a9 |
|
23-Nov-2013 |
Mathieu Chartier <mathieuc@google.com> |
Add developer option for dumping GC cumulative timings on shutdown. The option is "-XX:DumpGCPerformanceOnShutdown". Bug: 9986416 Change-Id: If6ebb26b3e611a9dead197740dbfc64e548dc388
|
50482234bed852766498321f71d2ff5e46e4fec2 |
|
21-Nov-2013 |
Mathieu Chartier <mathieuc@google.com> |
Compact zygote. We now start out using the bump pointer allocator and switch to the free list collector (ROSAlloc) after the zygote forks. Before compaction: Zygote size: 9060352 After compaction Zygote size: 8425864 The main reason the size doesn't reduce more is that most of the zygote space is non-movable objects allocated by VMRuntime.newNonMovableObject. The objects which are non-movable but could be movable include around 10000 classes and some number of fields and methods. Bug: 8981901 Change-Id: Iea21b70fb7af27cb7e92d72070d278a5cd4026ac
|
f9ed0d38c596d22c57d57e6111819bbb09e7d0fb |
|
22-Nov-2013 |
Mathieu Chartier <mathieuc@google.com> |
Fix concurrent GC to properly handle no zygote. I had introduced a regression in https://googleplex-android-review.googlesource.com/#/c/389851/ which caused concurrent GC to not get run if there was no zygote. This caused a regression in ritzperf when run from the commmand line. The fix properly handles the no zygote case by doing full GC instead. Bug: 11811477 Change-Id: Ib42b914509b951054895fea8741f6c68cdada52a
|
b2f9936cab87a187f078187c22d9b29d4a188a62 |
|
21-Nov-2013 |
Mathieu Chartier <mathieuc@google.com> |
Add histogram for GC pause times. Printed when you dump the GC performance info. Bug: 10855285 Change-Id: I3bf7f958305f97c52cb31c03bdd6218c321575b9
|
cbb2d20bea2861f244da2e2318d8c088300a3710 |
|
15-Nov-2013 |
Mathieu Chartier <mathieuc@google.com> |
Refactor allocation entrypoints. Adds support for switching entrypoints during runtime. Enables addition of new allocators with out requiring significant copy paste. Slight speedup on ritzperf probably due to more inlining. TODO: Ensuring that the entire allocation path is inlined so that the switch statement in the allocation code is optimized out. Rosalloc measurements: 4583 4453 4439 4434 4751 After change: 4184 4287 4131 4335 4097 Change-Id: I1352a3cbcdf6dae93921582726324d91312df5c9
|
cf58d4adf461eb9b8e84baa8019054c88cd8acc6 |
|
26-Sep-2013 |
Hiroshi Yamauchi <yamauchi@google.com> |
A custom 'runs-of-slots' memory allocator. Bug: 9986565 Change-Id: I0eb73b9458752113f519483616536d219d5f798b
|
39e3261168e7761fea6d873494d7c5d191285791 |
|
13-Nov-2013 |
Mathieu Chartier <mathieuc@google.com> |
Refactor reference queues. Refactored the reference queue processing to reside in the heap code. This removes significant code duplication in the semispace and marksweep garbage collectors. Changed the soft reference behaviour to preserve all soft references unless the GC requires them to be cleared to avoid an out of memory error. It may be worth investigating a better heuristic in the future to preserve soft references by LRU order. Change-Id: I1f3ff5bd4b3c5149271f4bb4fc94ba199e2f9bc2
|
5fe9af720048673e62ee29597a30bb9e54c903c5 |
|
14-Nov-2013 |
Ian Rogers <irogers@google.com> |
Fix memory leaks relating to timing logger. Bug: 11670287. We use pointers to uninitialized values for control-flow in the timing logger code, add TODO comments to clean this up later. Remove base namespace and other bits of tidying. Change-Id: I1e6600a1e92f974c8f58f3a405a4e4abb4d9f80f
|
bcd5e9daecad39f0dab3246808b4835caec29ea6 |
|
13-Nov-2013 |
Mathieu Chartier <mathieuc@google.com> |
Manually manage thread pool stacks. We now allocate the thread pool worker stack using a MemMap. This enables us to name the maps so that we get more descriptive output for debugging leaks. Appears to fix the mips build 5/5 successful clean-oat and builds. This is probably since glibc caches up to 40 MB of thread stacks before releasing them. Change-Id: I1df2de50cb95838aa0d272a09807021404ba410c
|
590fee9e8972f872301c2d16a575d579ee564bee |
|
13-Sep-2013 |
Mathieu Chartier <mathieuc@google.com> |
Compacting collector. The compacting collector is currently similar to semispace. It works by copying objects back and forth between two bump pointer spaces. There are types of objects which are "non-movable" due to current runtime limitations. These are Classes, Methods, and Fields. Bump pointer spaces are a new type of continuous alloc space which have no lock in the allocation code path. When you allocate from these it uses atomic operations to increase an index. Traversing the objects in the bump pointer space relies on Object::SizeOf matching the allocated size exactly. Runtime changes: JNI::GetArrayElements returns copies objects if you attempt to get the backing data of a movable array. For GetArrayElementsCritical, we return direct backing storage for any types of arrays, but temporarily disable the GC until the critical region is completed. Added a new runtime call called VisitObjects, this is used in place of the old pattern which was flushing the allocation stack and walking the bitmaps. Changed image writer to be compaction safe and use object monitor word for forwarding addresses. Added a bunch of added SIRTs to ClassLinker, MethodLinker, etc.. TODO: Enable switching allocators, compacting on background, etc.. Bug: 8981901 Change-Id: I3c886fd322a6eef2b99388d19a765042ec26ab99
|
fa82427c68b09f4aedbee319dc71579afbfc66f5 |
|
06-Nov-2013 |
Ian Rogers <irogers@google.com> |
Fix oatdump and valgrind. Bug: 11531382 Move allocation instrumentation out of runtime into instrumentation. Don't attempt to suspend threads in unstarted runtimes. Make indentation support sputc returning eof, on which it will sync and try again. A further failure likely means the disk is full. Move the dump-oat output directory to be art as now there's too much output to fit all the dump-oat data in our standard /tmp. Change-Id: I8ea848ace318552c180e2efa46570288ff1ca62c
|
8d31bbd3d6536de12bc20e3d29cfe03fe848f9da |
|
13-Oct-2013 |
Ian Rogers <irogers@google.com> |
Throw IOException at source of failing to open a dex file. Before is: java.lang.ClassNotFoundException: Didn't find class "GCBench" on path: DexPathList[[zip file "/disk2/dalvik-dev/out/host/linux-x86/framework/GCBench.jar"],nativeLibraryDirectories=[/disk2/dalvik-dev/out/host/linux-x86/lib]] at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56) at java.lang.ClassLoader.loadClass(ClassLoader.java:511) at java.lang.ClassLoader.loadClass(ClassLoader.java:469) Suppressed: java.lang.ClassNotFoundException: GCBench at java.lang.Class.classForName(Native Method) at java.lang.BootClassLoader.findClass(ClassLoader.java:781) at java.lang.BootClassLoader.loadClass(ClassLoader.java:841) at java.lang.ClassLoader.loadClass(ClassLoader.java:504) ... 1 more Caused by: java.lang.NoClassDefFoundError: Class "LGCBench;" not found ... 5 more And after is: java.lang.ClassNotFoundException: Didn't find class "GCBench" on path: DexPathList[[zip file "/disk2/dalvik-dev/out/host/linux-x86/framework/GCBench.jar"],nativeLibraryDirectories=[/disk2/dalvik-dev/out/host/linux-x86/lib]] at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56) at java.lang.ClassLoader.loadClass(ClassLoader.java:511) at java.lang.ClassLoader.loadClass(ClassLoader.java:469) Suppressed: java.io.IOException: Zip archive '/disk2/dalvik-dev/out/host/linux-x86/framework/GCBench.jar' doesn't contain classes.dex at dalvik.system.DexFile.openDexFile(Native Method) at dalvik.system.DexFile.<init>(DexFile.java:80) at dalvik.system.DexFile.<init>(DexFile.java:59) at dalvik.system.DexPathList.loadDexFile(DexPathList.java:268) at dalvik.system.DexPathList.makeDexElements(DexPathList.java:235) at dalvik.system.DexPathList.<init>(DexPathList.java:113) at dalvik.system.BaseDexClassLoader.<init>(BaseDexClassLoader.java:48) at dalvik.system.PathClassLoader.<init>(PathClassLoader.java:38) at java.lang.ClassLoader.createSystemClassLoader(ClassLoader.java:128) at java.lang.ClassLoader.access$000(ClassLoader.java:65) at java.lang.ClassLoader$SystemClassLoader.<clinit>(ClassLoader.java:81) at java.lang.ClassLoader.getSystemClassLoader(ClassLoader.java:137) Suppressed: java.lang.ClassNotFoundException: GCBench at java.lang.Class.classForName(Native Method) at java.lang.BootClassLoader.findClass(ClassLoader.java:781) at java.lang.BootClassLoader.loadClass(ClassLoader.java:841) at java.lang.ClassLoader.loadClass(ClassLoader.java:504) ... 1 more Caused by: java.lang.NoClassDefFoundError: Class "LGCBench;" not found ... 5 more Also, move dex file verifier messages out of logs. In the process the ClassLinker::dex_lock_ needed tidying to cover a smaller scope. Bug 11301553. Change-Id: I80058652e11e7ea63457cc01a0cb48afe1c15543
|
1eb512d33f94d1dd7ea38263307ba0f7a0dfa653 |
|
19-Oct-2013 |
Ian Rogers <irogers@google.com> |
Fast JNI support. Use a modifier to signal a native method is a fast JNI method. If the modifier is set then don't perform runnable transitions. Change-Id: I7835b4d837bfdd1cb8e2d54b919c0d5e6cf90499
|
be031fff278799984166ec866c2dd202447e0f23 |
|
09-Oct-2013 |
Hiroshi Yamauchi <yamauchi@google.com> |
Remove four counter increments out of the allocation path. - This change removes the four allocation counters (the number of bytes allocated, the number of objects allocated, the number of bytes allocated ever, the number of objects allocated ever) from the dlmalloc space allocation path. Now those counter values are computed on the fly based on a combination of the two new counters that are incremented by the GC side (the number of bytes freed ever and the number of objects freed ever) and mspace_inspect_all() calls. - This results in a 1-2% speedup (though with some noise) in Ritz MemAllocTest on Nexus 4. Bug: 9986565 Change-Id: Id9a8e05a745ac1e5ea7a2b5fd9319814a9d4af13
|
3b4c18933c24b8a33f38573c2ebcdb9aa16efeb5 |
|
13-Sep-2013 |
Hiroshi Yamauchi <yamauchi@google.com> |
Split the allocation path into 'instrumented' and 'uninstrumented' ones. The instrumented path is equivalent to the existing allocation path that checks for three instrumentation mechanisms (the debugger allocation tracking, the runtime allocation stats collection, and valgrind) for every allocation. The uinstrumented path does not perform these checks. We use the uninstrumented path by default and enable the instrumented path only when any of the three mechanisms is enabled. The uninstrumented version of Heap::AllocObject() is inlined. This change improves the Ritz MemAllocTest by ~4% on Nexus 4 and ~3% on Host/x86. Bug: 9986565 Change-Id: I3e68dfff6789d77bbdcea98457b694e1b5fcef5f
|
11409ae81a3eaf84d7fd2b3c85b8b06d2bae27f0 |
|
23-Sep-2013 |
Mathieu Chartier <mathieuc@google.com> |
Refactor and improve mod-union tables. Allow support for adding more mod union tables, reduces the amount of baked in logic. Adds support for updating mod union table references from compaction (not for ReferenceCache table yet). Change-Id: I1beeda00839ed86ef0e853beff5ce10d0ab2b9d1
|
fc0e94bed3f88ed7e50854fd8dfaf5dcb345250f |
|
24-Sep-2013 |
Ian Rogers <irogers@google.com> |
StringPiece clean up. Profile guided clean up. Try to avoid creating StringPieces with the contents of a dex file where the length is known. Try to avoid RegTypeCache::FromDescriptor when there's a class available. Make ConstantType::ConstantValue inlinable. Saving of about 50ms from a 2 threaded ThinkFree compile on host. Change-Id: I47a12c3c76f46e2c9805be1c3a3e3870fe1f5d85
|
0f72e4136aecaf6976fdb55916bbd7b6d5c9c77b |
|
07-Sep-2013 |
Mathieu Chartier <mathieuc@google.com> |
Improve heap verification. Re-enabled checking the allocation stack for heap verification. Added tracking of recent frees in DlMallocSpace if debug spaces is enabled. This is useful when you have heap corruption caused by a live object referencing a recently freed object. Added various other sanity checks in the GC. Bug: 10626133 Change-Id: I5ada11966336ae9a06615b16f4b933f05b5d0c32
|
b4ea4de2d6b63a3855968f2748878018a27af106 |
|
18-Sep-2013 |
Mathieu Chartier <mathieuc@google.com> |
Fix soft reference clearing issue. There was a bug where we would check that the pending next field was non null before enqueueing up cleared references. This was causing references to not get queued up during ProcessReferences. Bug: 10626133 Change-Id: Ic1e00e42045092280b4abb3d41f1c58f7adbc3de
|
423d2a3dcbb260b020efb5da59f784c9f02accbf |
|
13-Sep-2013 |
Mathieu Chartier <mathieuc@google.com> |
Add support for changing roots through the root visitor callback. Needed for copying collectors. Change-Id: Icc4a342a57e0cfb79587edb02ef8c85e08808877
|
31e8925781c2302f1d1a9b39e216ba415bfe0d7e |
|
28-Aug-2013 |
Mathieu Chartier <mathieuc@google.com> |
Write out image bitmap inside of image file. We now create the image bitmap when we generate the image. The image bitmap is written after the image inside of the image file. This speeds up dex2oat by making walking the image during heap creation unnecessary. This should also help memory pressure by enabling the image bitmap to be swappable. Bug: 10432288 Change-Id: Idebf459ed15edbb41a7d9b9b353934155bce2f19
|
2775ee4f82dff260663ca16adddc0b15327aaa42 |
|
21-Aug-2013 |
Mathieu Chartier <mathieuc@google.com> |
Add more runtime options. Changed HeapGCThreads to be split into two different options: -XX:ParallelGCThreads: Which specifies how many threads the GC may use when the mutators are suspended. -XX:ConcGCThreads: Which specifies how many threads the GC may use when the mutators are running. Added runtime options to specify long pause / long GC thresholds: -XX:LongPauseThreshold (default 5ms) -XX:LongGCThreshold (default 100ms) These thresholds were previously constants, but are now runtime options. If we exceed either of the thresholds, we print the GC message. Added a new runtime option: -XX:IgnoreMaxFootprint which makes it that the GC only does GC when the number of bytes allocated hits the growth limit. This causes GC to occur much less frequently and can be useful to measure how much of an impact GC has on performance. Changed the GC behaviour to use only one thread when we do not care about pauses to prevent jank that can be caused by 2 simultaneous GC on different processes fighting for CPU time. Added thread pool functionality for changing the maximum number of active workers. Fixed an accounting error where we didn't count large objects in the total freed. Bug: 9986416 Change-Id: I86afa358d93dcd3780e18ac5d85bdb1a130cb7e7
|
e53225c7b8c98f8fc3855fc70f718e7f8abab307 |
|
19-Aug-2013 |
Mathieu Chartier <mathieuc@google.com> |
Print information about large objects freed and AllocSpace objects. When we print information about the GC, we now print how many AllocSpace and LOS objects were freed along with their corresponding total sizes. Fixed a disabled timing longer which I had accidentally done in another CL. Change-Id: I6cf958ec553bdbb365f242b3844461acec801078
|
720ef7680573c1afd12f99f02eee3045daee5168 |
|
17-Aug-2013 |
Mathieu Chartier <mathieuc@google.com> |
Fix non concurrent GC ergonomics. If we dont have concurrent GC enabled, we need to force GC for alloc when we hit the maximum allowed footprint so that our heap doesn't keep growing until it hits the growth limit. Refactored a bit of stuff. Change-Id: I8eceac4ef01e969fd286ebde3a735a09d0a6dfc1
|
94c32c5f01c7d44781317bf23933ed0a5bc4b796 |
|
09-Aug-2013 |
Mathieu Chartier <mathieuc@google.com> |
More parallel GC, rewritten parallel mark stack processing. Card scanning may now be done in parallel. This speeds up sticky and reduces pause times for all GC types. Speedup on my mako (ritz perf): Average pause time for sticky GC (~250 samples): Without parallel cards scanning enabled: 2.524904215ms Parallel card scanning (num_gc_threads_): 1.552123552ms Throughput (~250 samples): Sticky GC throughput with parallel card scanning: 69MB/s Sticky GC throughput without parallel card scanning: 51MB/s Rewrote the mark stack processing to be LIFO and use a prefetch queue like the non parallel version. Cleaned up some of the logcat printing for the activity manager process state listening. Added unlikely hints to object scanning since arrays and classes are scanned much less often than normal objects. Fixed a bug where the number of GC threads was clamped to 1 due to a bool instead of a size_t. Fixed a race condition when we added references to the reference queues. Sharded the reference queue lock into one lock for each reference type (weak, soft, phatom, finalizer). Changed timing splits to be different for processing gray objects with and without mutators paused since sticky GC does both. Mask out the class bit when visiting fields as an optimization, this is valid since classes are held live by the class linker. Partially completed: Parallel recursive mark + finger. Bug: 10245302 Bug: 9969166 Bug: 9986532 Bug: 9961698 Change-Id: I142d09718c4609b7c2387cb28f517a6983c73288
|
02e25119b15a6f619f17db99f5d05124a5807ff3 |
|
15-Aug-2013 |
Mathieu Chartier <mathieuc@google.com> |
Fix up TODO: c++0x, update cpplint. Needed to update cpplint to handle const auto. Fixed a few cpplint errors that were being missed before. Replaced most of the TODO c++0x with ranged based loops. Loops which do not have a descriptive container name have a concrete type instead of auto. Change-Id: Id7cc0f27030f56057c544e94277300b3f298c9c5
|
ba041a59071036d5c78b70a372739e90cf6fe6d4 |
|
16-Aug-2013 |
Anwar Ghuloum <anwarg@google.com> |
Log long GC pause only when the process cares about pause time Change-Id: Iffdb83dff43020c3477b5391deb04102e00eb61e
|
ea46f950e7a51585db293cd7f047de190a482414 |
|
30-Jul-2013 |
Brian Carlstrom <bdc@google.com> |
Refactor java.lang.reflect implementation Cherry-picked from commit ed41d5c44299ec5d44b8514f6e17f802f48094d1. Move to ArtMethod/Field instead of AbstractMethod/Field and have java.lang.reflect APIs delegate to ArtMethod/ArtField. Bug: 10014286. Change-Id: Iafc1d8c5b62562c9af8fb9fd8c5e1d61270536e7
|
67f99418f648c3a95256ed3dcd8e8b64eef0b372 |
|
12-Aug-2013 |
Anwar Ghuloum <anwarg@google.com> |
Yet more timing logger cleanup Some cleanup of timing logger placement, additional systrace placement for threaded compilation work, tweaking/hiding of some type names per previous review comments. Change-Id: Ic7db2e02747282ac7f474b9a060df9803bfdfa5e
|
f981da1d60864a730f744ef2cc3a19391c8303f2 |
|
08-Aug-2013 |
Mathieu Chartier <mathieuc@google.com> |
Use JNI to access activity manager process state. After a GC occurs, we use JNI to access activity manager process state to decide whether or not we will trim. Change-Id: Iad981e3a7cdc694729d8792cc0f19e0262154388 (cherry picked from commit c39e342317d77e701b4cd01cd5b05902e6512f4b)
|
4446ab9e70dde779d97f451c4904f6b8770232bd |
|
10-Aug-2013 |
Anwar Ghuloum <anwarg@google.com> |
Systrace fixups and refactoring for TimingLogger Fixed systrace bounds for timing logger in GC. Refactored CumulativeLogger a bit to allow for multiple identical entries. Added ScopedSplit, now composes with explicit start/end/new splits. Adds some unit tests. Bug: 10036801 Change-Id: If0afb88b48ec3a1e19462ed354babb274a9517a7
|
c39e342317d77e701b4cd01cd5b05902e6512f4b |
|
08-Aug-2013 |
Mathieu Chartier <mathieuc@google.com> |
Use JNI to access activity manager process state. After a GC occurs, we use JNI to access activity manager process state to decide whether or not we will trim. Change-Id: Iad981e3a7cdc694729d8792cc0f19e0262154388
|
eb5710eba75bf338da56386ca29039df9d5134cb |
|
26-Jul-2013 |
Mathieu Chartier <mathieuc@google.com> |
New free list large object space. More memory efficient, uses a std::set instead of multiset. Each large object allocation has sizeof(size_t) * 2 bytes of overhead without taking into account the std::set overhead. If debug is enabled, then objects are mprotected as they are freed. Added a large object test to space test. Change-Id: I3e714e1afbed49208a4a7e60f9ef7d701a56801b
|
9642c96bd5a1ccc4e221de9c0af4a545af8182d2 |
|
06-Aug-2013 |
Mathieu Chartier <mathieuc@google.com> |
Move allocation stack unmarking outside of pause. Reduces pause time by moving the allocation stack unmarking outside of the pause. This is especially helpful for devices which have longer GC times since these times result in having more things to be unmarked in the allocation stack. Bug: 9969166 Change-Id: I570f2213cbdda9d90545b64538e2cbeb0dc32d16
|
e0a53e99e2a01f8668d6616c3cec7e2f5a711286 |
|
05-Aug-2013 |
Mathieu Chartier <mathieuc@google.com> |
Add low memory mode option to ART. Useful so that we match the option I added here: https://googleplex-android-review.googlesource.com/#/c/328940/ In ART low memory mode reduces the maximum number of histogram buckets. We also trim no matter the utilization. Change-Id: I655ba63312c0a6574569cdd5171ca81ea338c2aa
|
50b2928501fe489c108472e7648ec98cdca62e10 |
|
30-Jul-2013 |
Hiroshi Yamauchi <yamauchi@google.com> |
Improve the allocation speed. - Improves the Ritz MemAllocTest benchmark result by ~500 ms (or ~5%) on Nexus 4. - Move the memset() call that zeroes the allocated memory out of the lock region. - De-virtualize/Inline the allocation call chains into Heap::AllocObject(). - Turn Heap::measure_allocation_time_ into a static const variable. - Surround the VerifyObject() call with kIsDebugBuild. Bug: 9986565 Change-Id: Ib70b6d051a80ec329788b30256565561f031da2a
|
184e322fe8ddd75c844a1eb2eb1ca32bc02f2d45 |
|
03-Aug-2013 |
Mathieu Chartier <mathieuc@google.com> |
Disable and remove finger. Finger is useless for multithreaded GC, removing it should provide a slight speed up due to avoided comparison. Change-Id: I7eb7abcbab8d3307807b1086c06d68b2d4bcd2e9
|
161a8e0fcbf26922c97654c00b68082be71eeb50 |
|
02-Aug-2013 |
Mathieu Chartier <mathieuc@google.com> |
Fix accidental performance regression. Accidentally changed mod union table in another CL, slowed down partial GC by a bit. Change-Id: I8aba855a6b475da2969187ecd73f05c0667e470d
|
834b394ee759ed31c5371d8093d7cd8cd90014a8 |
|
31-Jul-2013 |
Brian Carlstrom <bdc@google.com> |
Merge remote-tracking branch 'goog/dalvik-dev' into merge-art-to-dalvik-dev Change-Id: I323e9e8c29c3e39d50d9aba93121b26266c52a46
|
0418ae2bdd996b64f733b1290080e3f98a05609f |
|
31-Jul-2013 |
Mathieu Chartier <mathieuc@google.com> |
GC a lot mode. Enabling GC a lot mode bounds the size of the allocation stack to a small value. Bug: 8509379 Change-Id: Ia098af54b755e03eb78c5128654edfca3f90f391
|
f082d3ce16c520b2d039869e8eb3055eda04e591 |
|
30-Jul-2013 |
Mathieu Chartier <mathieuc@google.com> |
Remove sorted variable in allocation stacks. Speeds up allocations, mark stack processing non parallel. This is safe to do since the pre/post GC heap verification is the only place where we sort the allocation and live stacks and this is done with mutators suspended. Change-Id: I4ae1858db7109def3e2e49ebca58b924818d71f2
|
7934ac288acfb2552bb0b06ec1f61e5820d924a4 |
|
26-Jul-2013 |
Brian Carlstrom <bdc@google.com> |
Fix cpplint whitespace/comments issues Change-Id: Iae286862c85fb8fd8901eae1204cd6d271d69496
|
6f28d91aab952e3244fbb4e707fa38f85538f374 |
|
25-Jul-2013 |
Anwar Ghuloum <anwarg@google.com> |
Add systrace support to NewTimingLogger, migrate compiler timing logging to NewTimingLogger Rpleaced old TimingLogger by NewTimingLogger, renamed NewTimingLogger to TimingLogger, added systrace support to TimingLogger. Tests passing, phone booting, systrace working. Change-Id: I2aeffb8bcb7f0fd979d8a2a3a8bcfbaa02413679
|
0a9dc05e704bfd033bac2aa38a4fc6f6b8e6cf93 |
|
25-Jul-2013 |
Mathieu Chartier <mathieuc@google.com> |
GC data structures allocation tracking Adds a new stl compatible allocator that is used in most GC data structures. When the data structures allocate and free memory, it lets the heap know of how much memory was allocated or freed. Using this info, we dump the approximated stl data structures memory usage when a sigquit occurs. The allocation tracking can be disabled with a compile time boolean flag to remove performance impact. Change-Id: Idddb6713169e07be913bceeb50f305c8573e4392
|
333cf1b3b3f55c937d4f72559504297df18951ff |
|
24-Jul-2013 |
Ian Rogers <irogers@google.com> |
Tidy OOME message. 1) Make fragmentation reporting not occur for LOS allocations. 2) Don't report bytes allocated in alloc and LOS as the free bytes are what matter and are already reported. The alloc and LOS sizes should have had units and describe bytes in the image and Zygote - but really, all you care about are free bytes. Change-Id: I53ad8744e07f2087a174ed650d10ee45f46a60b3
|
63a54345598861030178e033ffbd72c0e231a4c9 |
|
23-Jul-2013 |
Mathieu Chartier <mathieuc@google.com> |
Add option for changing number of GC threads. The number of threads was previously set to 1 by an accidential checkin. This hurts on all devices which aren't dual core. We now properly use sysconf to determine how many threads we should create. Also added a -XX:HeapGCThreads heap option which lets us change how many GC threads we create. The default value is equal to the number of processors on the device minus one. Change-Id: If65065ef09174a3813b8741efdd5ea7bbe82a4e2
|
09b07a96094086e205948717666025909a75163b |
|
15-Jul-2013 |
Hiroshi Yamauchi <yamauchi@google.com> |
Show size/alloc/free per Dalvik heap space in dumpsys Add the heap size/alloc/free stats to the Dalvik heap space breakdown section in dumpsys meminfo. Also, now the zygote heap has a distict ashmem region name. Bug: 9532137 Bug: 8266259 Change-Id: Ieeb02f5f5ebf7ffe35d4b55ad81d46989af2827b
|
4274889d48ef82369bf2c1ca70d84689b4f9e93a |
|
19-Jul-2013 |
Brian Carlstrom <bdc@google.com> |
Fixing cpplint readability/check issues Change-Id: Ia81db7238b4a13ff2e585aaac9d5e3e91df1e3e0
|
2d88862f0752a7a0e65145b088f49dabd49d4284 |
|
19-Jul-2013 |
Brian Carlstrom <bdc@google.com> |
Fixing cpplint readability/casting issues Change-Id: I6821da0e23737995a9b884a04e9b63fac640cd05
|
82353313bbe00d033b6733535d0dcd6f56c36d8d |
|
18-Jul-2013 |
Mathieu Chartier <mathieuc@google.com> |
Add interface for updating the heap's process state In the future, the heap's process state will be used to determine GC behavior. Change-Id: Iba4f038d28dbf483b6573d8feb25e4246ead1d50
|
df62950e7a32031b82360c407d46a37b94188fbb |
|
18-Jul-2013 |
Brian Carlstrom <bdc@google.com> |
Fix cpplint whitespace/parens issues Change-Id: Ifc678d59a8bed24ffddde5a0e543620b17b0aba9
|
f69863b3039fc621ff4250e262d2a024d5e79ec8 |
|
18-Jul-2013 |
Brian Carlstrom <bdc@google.com> |
Fix cpplint whitespace/newline issues Change-Id: Ie2049d9f667339e41f36c4f5d09f0d10d8d2c762
|
93ba893c20532990a430741e0a97212900094e8c |
|
18-Jul-2013 |
Brian Carlstrom <bdc@google.com> |
Fix cpplint runtime/explicit issues Change-Id: I352ba0b427f1ff9b22887693952b180eae0839ba
|
56d947fbc9bc2992e2f93112fafb73e50d2aaa7a |
|
15-Jul-2013 |
Brian Carlstrom <bdc@google.com> |
Add verification of boot.oat generated on device Change-Id: I069586205a9a92fc7375ccf5cdde136bbbcfc800
|
4b95e8fad803ad307fa09c11c08894544e07a731 |
|
16-Jul-2013 |
Mathieu Chartier <mathieuc@google.com> |
Refactor atomic integer. Refactored atomic integer to be similar to c++11 std::atomic<int>. Removed jdwp serial lock and reverted lock level name change from https://googleplex-android-review.googlesource.com/#/c/327297/ Change-Id: I2229f30c4d5762a0e8c72697d6aca4683750af35
|
7940e44f4517de5e2634a7e07d58d0fb26160513 |
|
12-Jul-2013 |
Brian Carlstrom <bdc@google.com> |
Create separate Android.mk for main build targets The runtime, compiler, dex2oat, and oatdump now are in seperate trees to prevent dependency creep. They can now be individually built without rebuilding the rest of the art projects. dalvikvm and jdwpspy were already this way. Builds in the art directory should behave as before, building everything including tests. Change-Id: Ic6b1151e5ed0f823c3dd301afd2b13eb2d8feb81
|