summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
authorjschuh@chromium.org <jschuh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-28 03:43:08 +0000
committerjschuh@chromium.org <jschuh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-28 03:43:08 +0000
commitfaf298c663a3450edfe4b4f9b2fd3e7615aa050b (patch)
tree0b369597719ed60eb32ae37abed271088a96defa /content
parenta39921b4191a7fb4685ae30614c645c377ebd410 (diff)
downloadchromium_src-faf298c663a3450edfe4b4f9b2fd3e7615aa050b.zip
chromium_src-faf298c663a3450edfe4b4f9b2fd3e7615aa050b.tar.gz
chromium_src-faf298c663a3450edfe4b4f9b2fd3e7615aa050b.tar.bz2
- Raise the total JIT cap 128mb.
- Add a 48mb cap for spikes over 8 minutes. - Increase the random hole to 512mb (to compensate for the higher cap). BUG=115658 BUG=113891 Review URL: https://chromiumcodereview.appspot.com/9447097 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@123882 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r--content/plugin/plugin_main.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/content/plugin/plugin_main.cc b/content/plugin/plugin_main.cc
index 4f4f402..2e7f4ea 100644
--- a/content/plugin/plugin_main.cc
+++ b/content/plugin/plugin_main.cc
@@ -84,10 +84,10 @@ void FreeRandomMemoryHole(void *hole) {
}
bool CreateRandomMemoryHole() {
- static const uint32_t kRandomValueMask = 0xFFF; // 4095
- static const uint32_t kRandomValueShift = 2;
- static const uint32_t kMaxWaitSeconds = 22 * 60; // 22 Minutes in seconds.
- COMPILE_ASSERT((kMaxWaitSeconds > (kRandomValueMask >> kRandomValueShift)),
+ const uint32_t kRandomValueMax = 8 * 1024; // Yields a 512mb max hole.
+ const uint32_t kRandomValueDivisor = 8;
+ const uint32_t kMaxWaitSeconds = 18 * 60; // 18 Minutes in seconds.
+ COMPILE_ASSERT((kMaxWaitSeconds > (kRandomValueMax / kRandomValueDivisor)),
kMaxWaitSeconds_value_too_small);
uint32_t rand_val;
@@ -95,14 +95,14 @@ bool CreateRandomMemoryHole() {
DVLOG(ERROR) << "rand_s() failed";
}
- rand_val &= kRandomValueMask;
- // Reserve up to 256mb (randomly selected) of address space.
+ rand_val %= kRandomValueMax;
+ // Reserve a (randomly selected) range of address space.
if (void* hole = ::VirtualAlloc(NULL, 65536 * (1 + rand_val),
MEM_RESERVE, PAGE_NOACCESS)) {
// Set up an event to remove the memory hole. Base the wait time on the
// inverse of the allocation size, meaning a bigger hole gets a shorter
- // wait (ranging from 5-22 minutes).
- const uint32_t wait = kMaxWaitSeconds - (rand_val >> kRandomValueShift);
+ // wait (ranging from 1-18 minutes).
+ const uint32_t wait = kMaxWaitSeconds - (rand_val / kRandomValueDivisor);
MessageLoop::current()->PostDelayedTask(FROM_HERE,
base::Bind(&FreeRandomMemoryHole, hole),
base::TimeDelta::FromSeconds(wait));