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

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

Issue 2793623002: android: Limit num renderer to service slots (Closed)
Patch Set: fix remaining unit tests Created 3 years, 9 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 d5aef3d4136fcfc77a0cd7b50c11f47d46b4179f..7cd641d04d20b6832aeacf0366fa4aacf812a9ce 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -619,7 +619,13 @@ size_t RenderProcessHost::GetMaxRendererProcessCount() {
// 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();
+ // TODO(boliu): This is a short term workaround before ChildProcessLauncher
+ // can actively kill child processes in LRU order. Bug and process is tracked
+ // in crbug.com/693484. Note this workaround is not perfect and still has
+ // corner case problems.
+ static const size_t kNumRendererSlots =
+ ChildProcessLauncher::GetNumberOfRendererSlots();
+ return kNumRendererSlots;
#endif
// On other platforms, we calculate the maximum number of renderer process

Powered by Google App Engine
This is Rietveld 408576698