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 298360 c26f56bea5e99e3cb335394ff0493a98b97561e0
parent 298359 412a3f1e075f30cbbdd4af0b6bcfafae58210e0b
child 298361 ee8a828b497498c8a4325e3007197c75af931c3b
push id962
push userjlund@mozilla.com
push dateFri, 04 Dec 2015 23:28:54 +0000
treeherdermozilla-release@23a2d286e80f [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");