diff options
author | Mathieu Chartier <mathieuc@google.com> | 2013-08-05 10:17:40 -0700 |
---|---|---|
committer | Mathieu Chartier <mathieuc@google.com> | 2013-08-05 14:53:05 -0700 |
commit | e0a53e99e2a01f8668d6616c3cec7e2f5a711286 (patch) | |
tree | d672967f101a31e1dbf739a2e13f0725625e2ca2 /runtime/base | |
parent | f929b1f270a880e1f98c7a3913a5a5468a2a2368 (diff) | |
download | art-e0a53e99e2a01f8668d6616c3cec7e2f5a711286.zip art-e0a53e99e2a01f8668d6616c3cec7e2f5a711286.tar.gz art-e0a53e99e2a01f8668d6616c3cec7e2f5a711286.tar.bz2 |
Add low memory mode option to ART.
Useful so that we match the option I added here:
https://googleplex-android-review.googlesource.com/#/c/328940/
In ART low memory mode reduces the maximum number of histogram
buckets. We also trim no matter the utilization.
Change-Id: I655ba63312c0a6574569cdd5171ca81ea338c2aa
Diffstat (limited to 'runtime/base')
-rw-r--r-- | runtime/base/timing_logger.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/runtime/base/timing_logger.cc b/runtime/base/timing_logger.cc index e2d2d4c..b58b0ac 100644 --- a/runtime/base/timing_logger.cc +++ b/runtime/base/timing_logger.cc @@ -113,7 +113,8 @@ void CumulativeLogger::AddPair(const std::string &label, uint64_t delta_time) { // Convert delta time to microseconds so that we don't overflow our counters. delta_time /= kAdjust; if (histograms_.size() <= index_) { - histograms_.push_back(new Histogram<uint64_t>(label.c_str(), 50)); + const size_t max_buckets = Runtime::Current()->GetHeap()->IsLowMemoryMode() ? 16 : 100; + histograms_.push_back(new Histogram<uint64_t>(label.c_str(), 50, max_buckets)); DCHECK_GT(histograms_.size(), index_); } histograms_[index_]->AddValue(delta_time); |