From 64a1e08b86d72cb375f9dfdf4eb6307f71817350 Mon Sep 17 00:00:00 2001 From: Mathias Agopian Date: Thu, 19 Apr 2012 17:31:53 -0700 Subject: [PATCH] SF doesn't need more than a few binder threads Change-Id: Ic4659fb81f9990cc7caf84a496a8ae659a1d16a9 --- cmds/surfaceflinger/main_surfaceflinger.cpp | 3 +++ include/binder/BinderService.h | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/cmds/surfaceflinger/main_surfaceflinger.cpp b/cmds/surfaceflinger/main_surfaceflinger.cpp index 6dbcf5c2f..28e58e4b9 100644 --- a/cmds/surfaceflinger/main_surfaceflinger.cpp +++ b/cmds/surfaceflinger/main_surfaceflinger.cpp @@ -21,5 +21,8 @@ using namespace android; int main(int argc, char** argv) { SurfaceFlinger::publishAndJoinThreadPool(true); + // When SF is launched in its own process, limit the number of + // binder threads to 4. + ProcessState::self()->setThreadPoolMaxThreadCount(4); return 0; } diff --git a/include/binder/BinderService.h b/include/binder/BinderService.h index ca594d363..646026841 100644 --- a/include/binder/BinderService.h +++ b/include/binder/BinderService.h @@ -40,7 +40,6 @@ public: } static void publishAndJoinThreadPool(bool allowIsolated = false) { - sp proc(ProcessState::self()); sp sm(defaultServiceManager()); sm->addService(String16(SERVICE::getServiceName()), new SERVICE(), allowIsolated); ProcessState::self()->startThreadPool();