OSDN Git Service

DO NOT MERGE Further refinement of card table clear
authorAndy McFadden <fadden@android.com>
Tue, 8 Nov 2011 00:57:54 +0000 (16:57 -0800)
committerAndy McFadden <fadden@android.com>
Thu, 10 Nov 2011 00:20:39 +0000 (16:20 -0800)
commitcab0fdf82a668e2a1a054cd6506835046218e419
tree709e8ba9238e1f0ca7e4e7118afde19573ee529b
parent6cd72bd0161459e21d496b927967bd0ca6fe0f94
DO NOT MERGE Further refinement of card table clear

We're currently using memset() to clear cards out to the growth
limit, which on a device configured for 48MB/128MB process caps
means we're sitting on 384KB or 1MB of pages.  We can reduce that
substantially.

This change attempts to reduce the memset() length to the currently
active portion of the card table, based on the placement of objects
in the "live objects" bitmap.  This should avoid faulting in card
pages that we don't actually need.

This is suboptimal when parts of the card table are used briefly
and then ignored for a while.  An alternative implementation, which
uses madvise(DONTNEED) aggressively, is also included (#ifdefed out).

Bug 5567332

(cherry-pick from master)

Change-Id: I6b181de20a0c8b6307acaebbc5d6dac20422f25d
vm/alloc/CardTable.cpp