OSDN Git Service

Don't be so agressive in quering the code cache for new methods
authorCalin Juravle <calin@google.com>
Mon, 14 Mar 2016 17:32:49 +0000 (17:32 +0000)
committerCalin Juravle <calin@google.com>
Fri, 22 Apr 2016 14:51:07 +0000 (15:51 +0100)
Interim fix for apps which JIT a lot and trigger a lot of I/O because of
profile data (e.g. gmscore).

This reduces the amount of data re-written to disk by a few order of
magnitude. (e.g. 43k instead of 3.5MB)

Proper fix which will make the writing smarter is coming.

Bug:27600652

(cherry picked from commit 815759a8194fc94c9d9e6e081c99bee38792ba91)

Change-Id: I28c14369ba6728acb42d4de7cb65df39791fb2a1

runtime/jit/profile_saver.cc

index 6fe17db..a2876f8 100644 (file)
@@ -34,9 +34,9 @@ static constexpr const uint64_t kMinimumTimeBetweenCodeCacheUpdatesNs = 2000 * k
 // TODO: read the constants from ProfileOptions,
 // Add a random delay each time we go to sleep so that we don't hammer the CPU
 // with all profile savers running at the same time.
-static constexpr const uint64_t kRandomDelayMaxMs = 20 * 1000;  // 20 seconds
+static constexpr const uint64_t kRandomDelayMaxMs = 40 * 1000;  // 40 seconds
 static constexpr const uint64_t kMaxBackoffMs = 5 * 60 * 1000;  // 5 minutes
-static constexpr const uint64_t kSavePeriodMs = 10 * 1000;  // 10 seconds
+static constexpr const uint64_t kSavePeriodMs = 40 * 1000;  // 40 seconds
 static constexpr const uint64_t kInitialDelayMs = 2 * 1000;  // 2 seconds
 static constexpr const double kBackoffCoef = 1.5;