summaryrefslogtreecommitdiffstats
path: root/chrome/browser/render_process_host.cc
diff options
context:
space:
mode:
authordeanm@chromium.org <deanm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-09-11 11:18:34 +0000
committerdeanm@chromium.org <deanm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-09-11 11:18:34 +0000
commitf47e22a2507faa7cdb0d048f6e03e952e1f8f814 (patch)
tree6318cf4a16b15ff5bbe8753c56f37da5822a63e2 /chrome/browser/render_process_host.cc
parent89bf2f07a135b6f6e4c8734ca41051746b9c0930 (diff)
downloadchromium_src-f47e22a2507faa7cdb0d048f6e03e952e1f8f814.zip
chromium_src-f47e22a2507faa7cdb0d048f6e03e952e1f8f814.tar.gz
chromium_src-f47e22a2507faa7cdb0d048f6e03e952e1f8f814.tar.bz2
Tuck the ram/num_processes map into a function, and remove a static initializer.
Review URL: http://codereview.chromium.org/1936 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2053 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/render_process_host.cc')
-rw-r--r--chrome/browser/render_process_host.cc23
1 files changed, 11 insertions, 12 deletions
diff --git a/chrome/browser/render_process_host.cc b/chrome/browser/render_process_host.cc
index c49e7fd..f101fa8 100644
--- a/chrome/browser/render_process_host.cc
+++ b/chrome/browser/render_process_host.cc
@@ -59,19 +59,18 @@
namespace {
-// Defines the maximum number of renderer processes according to the amount
-// of installed memory as reported by the OS. The table values are calculated
-// by assuming that you want the renderers to use half of the installed ram
-// and assuming that each tab uses ~25MB.
-const int kMaxRenderersByRamTier[] = {
- 4, // less than 256MB
- 8, // 256MB
- 12, // 512MB
- 16, // 768MB
- chrome::kMaxRendererProcessCount, // 1GB or more.
-};
-
unsigned int GetMaxRendererProcessCount() {
+ // Defines the maximum number of renderer processes according to the amount
+ // of installed memory as reported by the OS. The table values are calculated
+ // by assuming that you want the renderers to use half of the installed ram
+ // and assuming that each tab uses ~25MB.
+ static const int kMaxRenderersByRamTier[] = {
+ 4, // less than 256MB
+ 8, // 256MB
+ 12, // 512MB
+ 16, // 768MB
+ };
+
static unsigned int max_count = 0;
if (!max_count) {
int memory_tier = env_util::GetPhysicalMemoryMB() / 256;