summaryrefslogtreecommitdiffstats
path: root/runtime/hprof
Commit message (Collapse)AuthorAgeFilesLines
* ART: Weaken size check in hprofAndreas Gampe2015-08-281-4/+5
| | | | | | | | | | | | | | | | | Dumping the heap is a two-phase process. In the first phase, all objects are visited to fill the header tables. In the second phase, the tables are written out and the heap is visited again to write the object records. Deleting global references doesn't require the mutator lock. So it is possible to delete a global ref in-between the first and the second phase. This leads to a smaller set of object records. The result is still safe, as the object's class etc. is still in the header tables, and the object won't be deleted, so will still be dumped by itself. Bug: 23521263 Change-Id: I019c29b13ceb9f13e362c742662f1546d52c37a0
* Fix field ordering for String in hprofMathieu Chartier2015-06-231-23/+25
| | | | | | | | We were inserting value field after the Object field instead of the String fields. Bug: 22043800 Change-Id: Ibaddbd7299562949e32eceb625feac325539e3ce
* Add a way to determine if a large object is a zygote objectMathieu Chartier2015-06-031-2/+7
| | | | | | | Also fix a slight memory leak in LargeObjectMapSpace. Bug: 20674158 Change-Id: I2416df484e5b84a8c5cc0b5664c8cb102dc235f6
* Emit instance fields for java.lang.Object in hprofMathieu Chartier2015-06-031-3/+3
| | | | | | | Previously we omitted these fields. Bug: 20726205 Change-Id: I81c55919a4bd015bc0a4e7259a41a05dab534e11
* Add a way to SuspendAll for a long durationMathieu Chartier2015-06-021-1/+1
| | | | | | | | Hprof uses this mode to not cause thread suspend timeouts if GC tries while the hprof dump is running. Bug: 21063989 Change-Id: Ic6304620afd1489719a7e0e4299f829c90fe27cc
* ART: Clean up arm64 kNumberOfXRegisters usage.Vladimir Marko2015-05-261-0/+1
| | | | | | | | | | | | | | | | | | | | | 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
* In hprof, use an address within string for char array of empty string.Jeff Hao2015-05-141-2/+9
| | | | | Bug: 21089461 Change-Id: I203345caf74fba2e9bf0549256147d84d1bb829e
* In hprof, set string class instance size to that of an empty string.Jeff Hao2015-05-141-1/+5
| | | | | Bug: 21066704 Change-Id: Ic52193f5801117ca642055ea700fc4bc21b690e8
* Replace String CharArray with internal uint16_t array.Jeff Hao2015-04-271-4/+30
| | | | | | | | | | | | Summary of high level changes: - Adds compiler inliner support to identify string init methods - Adds compiler support (quick & optimizing) with new invoke code path that calls method off the thread pointer - Adds thread entrypoints for all string init methods - Adds map to verifier to log when receiver of string init has been copied to other registers. used by compiler and interpreter Change-Id: I797b992a8feb566f9ad73060011ab6f51eb7ce01
* Replace NULL with nullptrMathieu Chartier2015-04-221-3/+3
| | | | | | | Also fixed some lines that were too long, and a few other minor details. Change-Id: I6efba5fb6e03eb5d0a300fddb2a75bf8e2f175cb
* Move ArtField to nativeMathieu Chartier2015-04-101-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Ignore not yet loaded classes during hprofSebastien Hertz2015-04-071-0/+4
| | | | | | | | | Skips classes that are no yet loaded because we cannot access its fields nor its superclass. This CL fixes a crash observed during the run-test 130-hprof. Bug: 20040824 Change-Id: Ia618b6c1579d35dfd726726ca6d2ff4258d8a841
* Merge "ART: Add Clang's -Wused-but-marked-unused"Andreas Gampe2015-04-061-1/+1
|\
| * ART: Add Clang's -Wused-but-marked-unusedAndreas Gampe2015-04-031-1/+1
| | | | | | | | | | | | Add detection of wrong unused annotations. Fix our codebase. Change-Id: I85cc20f2eac71c1ec6c5c7cd6efb08454a629634
* | Refactor and improve GC root handlingMathieu Chartier2015-04-061-75/+66
|/ | | | | | | | | | | | | | | | | | | | | | 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
* Visit image roots for hprofMathieu Chartier2015-03-311-0/+1
| | | | | | | | Bug: 19995360 (cherry picked from commit 0cab5e68f14ee403380664146db6dc7ddfc32064) Change-Id: I17868bff2a701dc25291d41b9732c6b86f92be08
* Add more info to who called SuspendAllMathieu Chartier2015-03-131-1/+1
| | | | | | Helps diagnose related jank. Change-Id: I38191cdda723c6f0355d0197c494a3dff2b6653c
* Fix failing hprof DCHECKMathieu Chartier2015-03-061-11/+33
| | | | | | | Benign. Bug: 19627999 Change-Id: I20f3d36ffa1efaf23b40b6290c042df81eca2fea
* Fix byte and char Get32Mathieu Chartier2015-03-061-4/+4
| | | | | | | | | | | 8 bit and 16 bit fields aren't necessarily 32 bit aligned due to field packing. This was causing SIGBUS for hprof dumping some apps. Bug: 19627999 (cherry picked from commit 2ff8da6a4d44bcf6a72dca1b5294a72297c5ce26) Change-Id: If549412fc4d62c55bb6a46f11658fc60b822a27e
* More of the concurrent copying collector.Hiroshi Yamauchi2015-01-231-1/+11
| | | | | Bug: 12687968 Change-Id: I62f70274d47df6d6cab714df95c518b750ce3105
* Clean up the locks around Heap::VisitObjects().Hiroshi Yamauchi2015-01-201-11/+5
| | | | | | | | 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
* Print more info in MarkSweep::VerifyRootMathieu Chartier2015-01-151-7/+7
| | | | | | | | | | | | | | | | | | | | | | | 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
* ART: Hprof cleanupAndreas Gampe2015-01-131-673/+705
| | | | | | | | Refactor things a bit to make it easier to stream. Add a simple test that dumps the heap and runs hprov-conf on it. Change-Id: I79a9ad37d4cf41fa8d63d039586aa80394d96005
* Change hprof to use streamingMathieu Chartier2015-01-091-273/+300
| | | | | | | | | | | | | | | Previously, we compute the whole hprof dump in memory resulting in > 50MB of memory usage for some apps (such as maps). This could cause the app to get killed by the low memory killer. The solution works by doing the dump in 2 passes. The first pass calculates the size of the dump. The second pass starts by sending the DDMS header with the correct size, then does the rest of the hprof dump by streaming and sending data one HprofRecord at a time. Bug: 18921793 Change-Id: I7dd9f5cfe49799ba268095c994a8c2eb1fe493df
* ART: Track Flush & Close in FdFileAndreas Gampe2014-11-181-2/+7
| | | | | | | | | | | | | | Implement a check that aborts when a file hasn't been explicitly flushed and closed when it is destructed. Add WARN_UNUSED to FdFile methods. Update dex2oat, patchoat, scoped_flock and some gtests to pass with this. (cherry picked from commit 9433ec60b325b708b9fa87e699ab4a6565741494) Change-Id: I9ab03b1653e69f44cc98946dc89d764c3e045dd4
* ART: Replace COMPILE_ASSERT with static_assert (runtime)Andreas Gampe2014-11-031-2/+2
| | | | | | Replace all occurrences of COMPILE_ASSERT in the runtime tree. Change-Id: I01e420899c760094fb342cc6cb9e692dd670a0b2
* Enable -Wimplicit-fallthrough.Ian Rogers2014-10-091-2/+2
| | | | | | | | Falling through switch cases on a clang build must now annotate the fallthrough with the FALLTHROUGH_INTENDED macro. Bug: 17731372 Change-Id: I836451cd5f96b01d1ababdbf9eef677fe8fa8324
* Add detection of zygote vs app vs image objects in hprofMathieu Chartier2014-07-211-7/+19
| | | | | Bug: 16406673 Change-Id: Ic3e4a809c00b8379e42b074f9032ac106138be67
* Fix identifier size in the heap dump.Calin Juravle2014-07-171-2/+6
| | | | | | | | | We're using addresses as IDs and previously we would have written sizeof(void*) as the identifier size in the header. Heap references are actually uint32_t so writting 4 bytes should be enough. Bug: 16016862 Change-Id: I785abf5030681b6009370b7b2d7552e8b4b54e67
* Remove object_utils.h.Ian Rogers2014-07-161-1/+0
| | | | | | | | | 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
* Change FieldHelper to use a handle.Mathieu Chartier2014-06-061-11/+5
| | | | | | | | | | | | | | | | Fixed compaction bugs related to FieldHelper::GetType in: artSet32InstanceFromCode SetFieldValueImpl CheckReceiver Field_set interpreter::DoFieldPut MethodVerifier::VerifyISGet MethodVerifier::VerifyISPut MethodVerifier::VerifyIGetQuick Bug: 13077697 Change-Id: I7de9ded2893b5568d43e4daa86fd135bf5508b72
* Now we have a proper C++ library, use std::unique_ptr.Ian Rogers2014-05-191-1/+1
| | | | | | | Also remove the Android.libcxx.mk and other bits of stlport compatibility mechanics. Change-Id: Icdf7188ba3c79cdf5617672c1cfd0a68ae596a61
* Avoid marking old class linker and intern table roots during pause.Mathieu Chartier2014-03-041-1/+1
| | | | | | | | | | | | | | | | | | | | 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
* Change root visitor to use Object**.Mathieu Chartier2014-02-181-5/+5
| | | | | | | 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
* Add root types and thread id to root visiting.Mathieu Chartier2014-02-111-19/+12
| | | | | | | Enables us to pass the root type and thread id to hprof. Bug: 12680863 Change-Id: I6a0f1f9e3aa8f9b4033d695818ae7ca3460d67cb
* Object model changes to support 64bit.Ian Rogers2014-02-061-84/+96
| | | | | | | | | | | | | | | | | | | | | | | 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
* Avoid some string allocations.Vladimir Marko2013-11-211-1/+1
| | | | | | Also avoid building a string one character at a time. Change-Id: I3db26226c620a730b95637d5bfc23e2d4715cfb9
* Add support for changing roots through the root visitor callback.Mathieu Chartier2013-09-131-4/+4
| | | | | | Needed for copying collectors. Change-Id: Icc4a342a57e0cfb79587edb02ef8c85e08808877
* Refactor java.lang.reflect implementationBrian Carlstrom2013-08-131-5/+4
| | | | | | | | | | | 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
* Fix cpplint whitespace/comments issuesBrian Carlstrom2013-07-261-9/+9
| | | | Change-Id: Iae286862c85fb8fd8901eae1204cd6d271d69496
* Fixing cpplint readability/casting issuesBrian Carlstrom2013-07-181-6/+6
| | | | Change-Id: I6821da0e23737995a9b884a04e9b63fac640cd05
* Fix multiple inclusion guards to match new pathnamesBrian Carlstrom2013-07-171-3/+3
| | | | Change-Id: Id7735be1d75bc315733b1773fba45c1deb8ace43
* Create separate Android.mk for main build targetsBrian Carlstrom2013-07-122-0/+1120
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