Bug 1219501 - Limit total number of image decoding threads to 32 regardless of number asked for. r=seth, a=ritu
authorTimothy Nikkel <tnikkel@gmail.com>
Sun, 01 Nov 2015 11:45:40 -0600
changeset 296655 c26f56bea5e9
parent 296654 412a3f1e075f
child 296656 ee8a828b4974
push id5276
push usercbook@mozilla.com
push date2015-11-09 10:31 +0000
treeherdermozilla-beta@be9dcc3b97b3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersseth, ritu
bugs1219501
milestone43.0
Bug 1219501 - Limit total number of image decoding threads to 32 regardless of number asked for. r=seth, a=ritu
image/DecodePool.cpp
--- a/image/DecodePool.cpp
+++ b/image/DecodePool.cpp
@@ -342,16 +342,19 @@ DecodePool::DecodePool()
       // even if under load we can't actually get that level of parallelism.
       limit = 2;
     } else {
       limit = numCores - 1;
     }
   } else {
     limit = static_cast<uint32_t>(prefLimit);
   }
+  if (limit > 32) {
+    limit = 32;
+  }
 
   // Initialize the thread pool.
   for (uint32_t i = 0 ; i < limit ; ++i) {
     nsCOMPtr<nsIRunnable> worker = new DecodePoolWorker(mImpl);
     nsCOMPtr<nsIThread> thread;
     nsresult rv = NS_NewThread(getter_AddRefs(thread), worker);
     MOZ_RELEASE_ASSERT(NS_SUCCEEDED(rv) && thread,
                        "Should successfully create image decoding threads");