Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(288)

Unified Diff: content/browser/renderer_host/render_process_host_impl.cc

Issue 356453003: Don't share renderers between unrelated tabs on Android. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address John(me)'s comments. Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/render_process_host_impl.cc
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
index 61fb09e8b09014194d037c6c0905e2f856a47954..6b6c3a1040b8d55b56c17dde961eab002669bcd9 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -394,15 +394,22 @@ size_t RenderProcessHost::GetMaxRendererProcessCount() {
if (g_max_renderer_count_override)
return g_max_renderer_count_override;
- // Defines the maximum number of renderer processes according to the
- // amount of installed memory as reported by the OS. The calculation
- // assumes that you want the renderers to use half of the installed
- // RAM and assuming that each WebContents uses ~40MB.
- // If you modify this assumption, you need to adjust the
- // ThirtyFourTabs test to match the expected number of processes.
+#if defined(OS_ANDROID)
+ // On Android we don't maintain a limit of renderer process hosts - we are
+ // happy with keeping a lot of these, as long as the number of live renderer
+ // processes remains reasonable, and on Android the OS takes care of that.
+ return std::numeric_limits<size_t>::max();
+#endif
+
+ // On other platforms, we calculate the maximum number of renderer process
+ // hosts according to the amount of installed memory as reported by the OS.
+ // The calculation assumes that you want the renderers to use half of the
+ // installed RAM and assuming that each WebContents uses ~40MB. If you modify
+ // this assumption, you need to adjust the ThirtyFourTabs test to match the
+ // expected number of processes.
//
- // With the given amounts of installed memory below on a 32-bit CPU,
- // the maximum renderer count will roughly be as follows:
+ // With the given amounts of installed memory below on a 32-bit CPU, the
+ // maximum renderer count will roughly be as follows:
//
// 128 MB -> 3
// 512 MB -> 6
« no previous file with comments | « content/browser/android/content_startup_flags.cc ('k') | content/browser/renderer_host/render_process_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698