summaryrefslogtreecommitdiffstats
path: root/runtime/gc/heap.h
diff options
context:
space:
mode:
authorHiroshi Yamauchi <yamauchi@google.com>2014-03-07 13:59:08 -0800
committerHiroshi Yamauchi <yamauchi@google.com>2014-03-14 17:45:08 -0700
commit38e68e9978236db87c9008bbe47db80525d2fa16 (patch)
treed678fea32b91d148e33c71ff0e6a53a90f2585b8 /runtime/gc/heap.h
parentfb5b21d1d598b6b42e5d5ca1dac4a040832558fb (diff)
downloadart-38e68e9978236db87c9008bbe47db80525d2fa16.zip
art-38e68e9978236db87c9008bbe47db80525d2fa16.tar.gz
art-38e68e9978236db87c9008bbe47db80525d2fa16.tar.bz2
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
Diffstat (limited to 'runtime/gc/heap.h')
-rw-r--r--runtime/gc/heap.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/runtime/gc/heap.h b/runtime/gc/heap.h
index 1e0a596..de20a4e 100644
--- a/runtime/gc/heap.h
+++ b/runtime/gc/heap.h
@@ -56,6 +56,7 @@ namespace accounting {
class HeapBitmap;
class ModUnionTable;
class ObjectSet;
+ class RememberedSet;
} // namespace accounting
namespace collector {
@@ -541,6 +542,10 @@ class Heap {
accounting::ModUnionTable* FindModUnionTableFromSpace(space::Space* space);
void AddModUnionTable(accounting::ModUnionTable* mod_union_table);
+ accounting::RememberedSet* FindRememberedSetFromSpace(space::Space* space);
+ void AddRememberedSet(accounting::RememberedSet* remembered_set);
+ void RemoveRememberedSet(space::Space* space);
+
bool IsCompilingBoot() const;
bool HasImageSpace() const;
@@ -660,7 +665,7 @@ class Heap {
void SwapStacks(Thread* self);
// Clear cards and update the mod union table.
- void ProcessCards(TimingLogger& timings);
+ void ProcessCards(TimingLogger& timings, bool use_rem_sets);
// Signal the heap trim daemon that there is something to do, either a heap transition or heap
// trim.
@@ -701,6 +706,9 @@ class Heap {
// A mod-union table remembers all of the references from the it's space to other spaces.
SafeMap<space::Space*, accounting::ModUnionTable*> mod_union_tables_;
+ // A remembered set remembers all of the references from the it's space to the target space.
+ SafeMap<space::Space*, accounting::RememberedSet*> remembered_sets_;
+
// Keep the free list allocator mem map lying around when we transition to background so that we
// don't have to worry about virtual address space fragmentation.
UniquePtr<MemMap> allocator_mem_map_;