主题:【原创】漫谈浏览器大战 -- (构架篇) -- Highway
in chrome/browser/renderer_host/render_process_host.cc
// 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
// ~40MB, however the curve is not linear but piecewise linear with
// interleaved slopes of 3 and 2.
// If you modify this table you need to adjust browser\browser_uitest.cc
// to match the expected number of processes.
static const size_t kMaxRenderersByRamTier[] = {
3, // less than 256MB
6, // 256MB
9, // 512MB
12, // 768MB
14, // 1024MB
18, // 1280MB
20, // 1536MB
22, // 1792MB
24, // 2048MB
26, // 2304MB
29, // 2560MB
32, // 2816MB
35, // 3072MB
38, // 3328MB
40 // 3584MB
};
static size_t max_count = 0;
if (!max_count) {
size_t memory_tier = base::SysInfo::AmountOfPhysicalMemoryMB() / 256;
if (memory_tier >= arraysize(kMaxRenderersByRamTier))
max_count = chrome::kMaxRendererProcessCount;
else
max_count = kMaxRenderersByRamTier[memory_tier];
}
return max_count;
}
- 相关回复 上下关系8
🙂chrome的新进程不会太多 1 向前向前 字74 2010-12-20 19:47:42
🙂你可以做一个简单的实验。 1 Highway 字256 2010-12-20 19:53:29
🙂这个没错,chrome目前就是每个扩展一个进程 向前向前 字115 2010-12-21 01:40:34
🙂source codes, version 5.x.x.
🙂呵呵,看来太守是同行? 向前向前 字0 2010-12-21 01:59:42
🙂flower. 1 Pita 字84 2010-12-20 13:31:23
🙂You made right choice 6 Highway 字435 2010-12-20 19:48:05
🙂webkit2 3 素里太守 字222 2010-12-20 03:43:42