diff options
author | Mathieu Chartier <mathieuc@google.com> | 2014-04-15 15:37:02 -0700 |
---|---|---|
committer | Mathieu Chartier <mathieuc@google.com> | 2014-04-16 12:37:09 -0700 |
commit | 2f8da3e9ff60e5cb2a3fdf57dbcb67f513b9c2c2 (patch) | |
tree | cfe10d3409b9cdd5c9453c6fbd12854039ac5ca9 /runtime/gc/heap.h | |
parent | 9623c6668962559e818d1e7f05a58dcb96c71fa9 (diff) | |
download | art-2f8da3e9ff60e5cb2a3fdf57dbcb67f513b9c2c2.zip art-2f8da3e9ff60e5cb2a3fdf57dbcb67f513b9c2c2.tar.gz art-2f8da3e9ff60e5cb2a3fdf57dbcb67f513b9c2c2.tar.bz2 |
Decrease target utilization for foreground apps.
GC time in FormulaEvaluationActions.EvaluateAndApplyChanges goes from
26.1s to 23.2s. Benchmark score goes down ~50 in
FormulaEvaluationActions.EvaluateAndApplyChanges, and up ~50 in
GenericCalcActions.MemAllocTest.
Bug: 8788501
Change-Id: I412af1205f8b67e70a12237c990231ea62167bc0
Diffstat (limited to 'runtime/gc/heap.h')
-rw-r--r-- | runtime/gc/heap.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/runtime/gc/heap.h b/runtime/gc/heap.h index 874357f..35724e3 100644 --- a/runtime/gc/heap.h +++ b/runtime/gc/heap.h @@ -132,9 +132,8 @@ class Heap { static constexpr size_t kDefaultLongPauseLogThreshold = MsToNs(5); static constexpr size_t kDefaultLongGCLogThreshold = MsToNs(100); static constexpr size_t kDefaultTLABSize = 256 * KB; - - // Default target utilization. static constexpr double kDefaultTargetUtilization = 0.5; + static constexpr double kDefaultHeapGrowthMultiplier = 2.0; // Used so that we don't overflow the allocation time atomic integer. static constexpr size_t kTimeAdjust = 1024; @@ -148,7 +147,8 @@ class Heap { // image_file_names names specify Spaces to load based on // ImageWriter output. explicit Heap(size_t initial_size, size_t growth_limit, size_t min_free, - size_t max_free, double target_utilization, size_t capacity, + size_t max_free, double target_utilization, + double foreground_heap_growth_multiplier, size_t capacity, const std::string& original_image_file_name, CollectorType foreground_collector_type, CollectorType background_collector_type, size_t parallel_gc_threads, size_t conc_gc_threads, bool low_memory_mode, @@ -351,6 +351,10 @@ class Heap { return low_memory_mode_; } + // Returns the heap growth multiplier, this affects how much we grow the heap after a GC. + // Scales heap growth, min free, and max free. + double HeapGrowthMultiplier() const; + // Freed bytes can be negative in cases where we copy objects from a compacted space to a // free-list backed space. void RecordFree(ssize_t freed_objects, ssize_t freed_bytes); @@ -927,6 +931,9 @@ class Heap { // Target ideal heap utilization ratio double target_utilization_; + // How much more we grow the heap when we are a foreground app instead of background. + double foreground_heap_growth_multiplier_; + // Total time which mutators are paused or waiting for GC to complete. uint64_t total_wait_time_; |