Commit 449553a3 authored by Peter Kasting's avatar Peter Kasting Committed by Commit Bot

Update estimated renderer process memory cost based on recent data.

This number was last updated in 2012.  The numbers here are based on the last
week of Windows stable data, taking the mean across all samples.  Other desktop
platforms have higher means than Windows, so this is still aggressive compared
to what we could do.

The expectation is that this change should reduce the total number of renderer
processes we create, and result in reducing the total renderer memory footprint.

Bug: 22546
Change-Id: I2308759644ed2720e4904052e93b37d6ee8367fa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1772641
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Commit-Queue: Ken Buchanan <kenrb@chromium.org>
Auto-Submit: Peter Kasting <pkasting@chromium.org>
Reviewed-by: default avatarKen Buchanan <kenrb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#690943}
parent ad308d5f
...@@ -549,9 +549,9 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, ThirtyFourTabs) { ...@@ -549,9 +549,9 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, ThirtyFourTabs) {
// for the algorithm to decide how many processes to create. // for the algorithm to decide how many processes to create.
const int kExpectedProcessCount = const int kExpectedProcessCount =
#if defined(ARCH_CPU_64_BITS) #if defined(ARCH_CPU_64_BITS)
17; 12;
#else #else
25; 17;
#endif #endif
if (base::SysInfo::AmountOfPhysicalMemoryMB() >= 2048) { if (base::SysInfo::AmountOfPhysicalMemoryMB() >= 2048) {
EXPECT_GE(CountRenderProcessHosts(), kExpectedProcessCount); EXPECT_GE(CountRenderProcessHosts(), kExpectedProcessCount);
......
...@@ -1328,11 +1328,11 @@ size_t RenderProcessHost::GetMaxRendererProcessCount() { ...@@ -1328,11 +1328,11 @@ size_t RenderProcessHost::GetMaxRendererProcessCount() {
// below on a 64-bit CPU, the maximum renderer count based on available RAM // below on a 64-bit CPU, the maximum renderer count based on available RAM
// alone will be as follows: // alone will be as follows:
// //
// 128 MB -> 1 // 128 MB -> 0
// 512 MB -> 4 // 512 MB -> 3
// 1024 MB -> 8 // 1024 MB -> 6
// 4096 MB -> 34 // 4096 MB -> 24
// 16384 MB -> 136 // 16384 MB -> 96
// //
// Then the calculated value will be clamped by |kMinRendererProcessCount| and // Then the calculated value will be clamped by |kMinRendererProcessCount| and
// GetPlatformMaxRendererProcessCount(). // GetPlatformMaxRendererProcessCount().
...@@ -1341,9 +1341,9 @@ size_t RenderProcessHost::GetMaxRendererProcessCount() { ...@@ -1341,9 +1341,9 @@ size_t RenderProcessHost::GetMaxRendererProcessCount() {
if (!max_count) { if (!max_count) {
static constexpr size_t kEstimatedWebContentsMemoryUsage = static constexpr size_t kEstimatedWebContentsMemoryUsage =
#if defined(ARCH_CPU_64_BITS) #if defined(ARCH_CPU_64_BITS)
60; // In MB 85; // In MB
#else #else
40; // In MB 60; // In MB
#endif #endif
max_count = base::SysInfo::AmountOfPhysicalMemoryMB() / 2; max_count = base::SysInfo::AmountOfPhysicalMemoryMB() / 2;
max_count /= kEstimatedWebContentsMemoryUsage; max_count /= kEstimatedWebContentsMemoryUsage;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment