summaryrefslogtreecommitdiffstats
path: root/runtime/gc/gc_cause.h
diff options
context:
space:
mode:
authorZuo Wang <zuo.wang@intel.com>2014-07-10 04:26:41 -0700
committerMathieu Chartier <mathieuc@google.com>2014-07-11 18:32:07 -0700
commitf37a88b8e6db6c587fa449a12e40cb46be1689fc (patch)
tree2e1d8b20e87796e1ad5d682dcce2a52a37f20123 /runtime/gc/gc_cause.h
parent9531f62ef260cbd0d0512e4c96f5d5dd2f4fdbb2 (diff)
downloadandroid_art-f37a88b8e6db6c587fa449a12e40cb46be1689fc.tar.gz
android_art-f37a88b8e6db6c587fa449a12e40cb46be1689fc.tar.bz2
android_art-f37a88b8e6db6c587fa449a12e40cb46be1689fc.zip
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>
Diffstat (limited to 'runtime/gc/gc_cause.h')
-rw-r--r--runtime/gc/gc_cause.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/runtime/gc/gc_cause.h b/runtime/gc/gc_cause.h
index 10e6667e11..1f2643a9ac 100644
--- a/runtime/gc/gc_cause.h
+++ b/runtime/gc/gc_cause.h
@@ -39,6 +39,8 @@ enum GcCause {
kGcCauseDisableMovingGc,
// Not a real GC cause, used when we trim the heap.
kGcCauseTrim,
+ // GC triggered for background transition when both foreground and background collector are CMS.
+ kGcCauseHomogeneousSpaceCompact,
};
const char* PrettyCause(GcCause cause);