History log of /dalvik/vm/alloc/HeapSource.cpp
Revision Date Author Comments
0cea134bef68f348225178dacf03716d4907bdbe 11-May-2012 SangWook Han <swhan@nemustech.com> Fix: Issue 26627: Dalvik Heap Trim timer value after GC

dvmRelativeCondWait need millisecods not seconds.

With this fix, trim will begins 5 seconds after concurrent GC

Bug: http://code.google.com/p/android/issues/detail?id=26627
Bug: 6482868
Change-Id: I3802b48e345725fb78e4ef2c999dd243ef30a138
b74e7190e86d559712747e5cdb31a0d390b7af7d 16-Feb-2012 Iliyan Malchev <malchev@google.com> Replace malloc() followed by memset() to zero with calloc()

Bionic's calloc() is smart enough to not zero out memory if it gets that memory
from an anonyous mmap. Thus, if we use malloc for large allocations, we cause
unnecessary memory duplication by following the malloc() with a memset().

An even better approach would be to replace the known large calloc() calls with
dvmAllocRegion() allocation.

Change-Id: Id308f541c9a040d5929bf991b6c2bfdefb823c3c
c1a4ab9c313d8a3d12007f2dbef7b5a6fa4ac2ef 06-Jan-2012 Steve Block <steveblock@google.com> Rename (IF_)LOGE(_IF) to (IF_)ALOGE(_IF) DO NOT MERGE

See https://android-git.corp.google.com/g/#/c/157220

Also fix an occurrence of LOGW missed in an earlier change.

Bug: 5449033
Change-Id: I2e3b23839e6dcd09015d6402280e9300c75e3406
af6cf54652d1b27885b99e216bee29b955052630 04-Nov-2011 Andy McFadden <fadden@android.com> Reduce Dalvik card table overhead

The VM has a "growth limit" (e.g. 48MB) that is used to cap normal
apps, and a "max heap" (e.g. 128MB) that is used for apps with unusual
high-memory requirements. The Dalvik GC uses a 128:1 "card table"
that spans the entire managed heap, out to the "max heap" limit.

The table is erased during every concurrent GC. The first time
we do that post-zygote, the copy-on-write behavior causes physical
pages to be allocated. We're currently clearing out to the heap max,
not the growth limit, which means we have a bunch of physical memory
allocated for pages that will never be used.

This changes it so we only clear out to the growth limit. If the
growth limit is removed by the app, we clear out to the heap max.
On devices with a 128MB max heap, this reduces the private/dirty
usage for most apps by 640KB.

Bug 5567332

Change-Id: Iac633017c128d63b284d48016e47d40cc46df1de
92c1f6f1b4249e4e379452ee7b49f027052bf4ce 20-Oct-2011 Steve Block <steveblock@google.com> Rename (IF_)LOGV(_IF) to (IF_)ALOGV(_IF) DO NOT MERGE

See https://android-git.corp.google.com/g/#/c/143865

Bug: 5449033
Change-Id: I8bd96961e369a08e86ff78b82d90f20f42787eb1
b2714082bad44fde247920b9280c1b40c4979c3a 10-Oct-2011 Ben Cheng <bccheng@android.com> Revert "Use the card table to scan the immune region of the heap."

This reverts commit 6c355e53332502314c3d82a7afcf898d66118f27.

Conflicts are resolved in:

vm/alloc/CardTable.cpp
vm/alloc/HeapBitmap.cpp
vm/alloc/HeapInternal.h
vm/alloc/HeapSource.cpp
vm/alloc/MarkSweep.cpp

Tested with overnight monkey runs + Delaunay.

Bug: 5037417
Change-Id: I400eff8542d0bddd865ce570a479f7750c1ba484
fe9052edaf6bebbccaac5a9fb607012778d0dd74 20-Jul-2011 Jeff Brown <jeffbrown@google.com> Trim the heap when idle after concurrent GC's.
Bug: 4984352

When applied system-wide, trimming the heap can help recover
multiple megabytes worth of pages that are no longer used.
This is especially useful for applications that periodically
allocate large objects during initialization that they then
discard when running in the background.

Change-Id: Iafffd65a70ae62022f0c74f836a84a7afbe23c3c
fd31cc071c83bdbe45e6f9db41fd76375e7ac310 10-Jun-2011 Carl Shapiro <cshapiro@google.com> Do not initiate a concurrent collection if one is already running.

It is possible to cause a recursive garbage collection by writing a
program that triggers a concurrent garbage collection and initiates a
concurrent garbage collection before the garbage collection thread is
scheduled. For example

for (;;) { new byte[16 << 20]; System.gc(); }

When this condition occurs a warning is logged although such warnings
ought to be upgraded to fatal errors. With this change, when the
garbage collection thread is scheduled it first checks to see if there
is a running collection before calling down to start the collection.

Change-Id: Ia7baf5eba245bbf3fe053d3bad3f90876cad2459
0c13923b0616dc79fcfc41b63119268273bdc8be 10-Jun-2011 Carl Shapiro <cshapiro@google.com> Always grow the limit address of the a heap along with its size.

Previously, clearing the growth limit only updated the maximumSize of
the unlimited heap without updating the limit value. This caused any
operations iterated over the extent of the heap to ignore allocations
beyond the original heap size. With this change the limit is always
kept in agreement with the maximumSize.

Bug: 4539441
Change-Id: I08c8004e724549d196e1fd5d6ad22efc85b0c8d2
60fc806b679a3655c228b4093058c59941a49cfe 26-May-2011 Dan Bornstein <danfuzz@android.com> Further conservation of newlines.

Friends don't let friends end LOG() strings with newlines.

Change-Id: I5a18c766c90c4ab5f03caa6acd601d34d91beb00
d537d4840fcdf0e279b6a7c91a27306e0544aeaa 26-May-2011 Carl Shapiro <cshapiro@google.com> Eliminate the dvmHeapSourceGetPtrFlag interface.

This routine served answering questions about object addresses. While
it was private to the garbage collector, its remaining use was inside
the heap profiler. Within the heap profiler, a single path was
executed to tested a pointer for containment within the zygote. In
its place, a new function, dvmIsZygoteObject, has been added to the GC
interface superseding the only use of dvmHeapSourceGetPtrFlag.

Change-Id: I347c9adb293bd6c196bbac3765015453133dc492
7e46af2973841f63b9301e5515f8381478b806ae 12-May-2011 Carl Shapiro <cshapiro@google.com> Various code clean-ups.

* Combine definitions with initialization. This had to be foregone in
two instances where that would have otherwise caused an unused variable
warning.

* Move the HS_BOILERPLATE macro to the top of the calling function. This
macro checks that certain globals are initialized. It should be removed
after the callers become members functions of a class.

* A few cases of inconsistent function declaration styles have been brought
in line with the rest of the file. These were overlooked in a previous
clean-up.

* The unused heap source debugging macros and tracing code have been
removed.

* One stale comments has been removed and another has been updated.

Change-Id: I20bf4b78161096310b79d7dd294d7636e6bb6f48
06f120f6092185003bc9b70e06eb44866e9676f8 11-May-2011 Carl Shapiro <cshapiro@google.com> Normalize declaration style.

Change-Id: Iae4e3d22bc185060b3a0b4c080eafaa2ec824ac2
d862faa2ceae186da5518607505eb942d634ced9 28-Apr-2011 Carl Shapiro <cshapiro@google.com> Get rid of uneeded extern, enum, typedef and struct qualifiers.

Change-Id: I236c5a1553a51f82c9bc3eaaab042046c854d3b4
5cdd4a3f91d3fc25c8eeca8f58e35bb6c4e908ca 28-Apr-2011 Carl Shapiro <cshapiro@google.com> Normalize some enumerations.

This change pulls a few enumeration types to the top of their header
file alongside other types. It also eliminates the use of the now
redundant enum qualifier.

Change-Id: I6f853bed09176cde9a83faccea7a76f595f60f2b
50e5fd5984c9b0a6f0927ed5ddf13bde40e338c7 27-Apr-2011 Carl Shapiro <cshapiro@google.com> Use C++ linkage in GC headers and remove unneeded typedefs.

Some interfaces in Alloc.h had to be left with C linkage as they are
referenced by the interpreter assembler code. That dependency will be
addressed in a future commit.

Change-Id: I6b2097a2139ddf6b4b13e592710e241442e08488
1e1433e78f560a01744e870c19c162ab88df9dc1 21-Apr-2011 Carl Shapiro <cshapiro@google.com> Remove unneeded void argument list declarations.

Change-Id: Ica749f6defa890363ec531b29e25bc415dc2cbb9
f9fa8c14c7ef87b4318d606bfc5132df7b77b17c 09-Apr-2011 Carl Shapiro <cshapiro@google.com> Fix for loops and eliminate some other undesirable idioms.

Previously, we were using a non-standard C dialect which did not permit
the nicer variable scoping in loops. Now that we are using C++ in the
collector we can guarantee that feature is available. This change also
rearranges some of the surrounding code to take advantage of the more
flexible scoping rules.

Change-Id: I9be35794cc12bcbc0d5299fe387d4bc406481075
ae188c676c681e47a93ade7fdf0144099b470e03 08-Apr-2011 Carl Shapiro <cshapiro@google.com> Compile the garbage collector and heap profiler as C++.

Change-Id: I25d8fa821987a3dd6d7109d07fd42dbf2fe0e589