Bug 1219501. Limit total number of image decoding threads to 32 regardless of number asked for. r=seth
authorTimothy Nikkel <tnikkel@gmail.com>
Sun, 01 Nov 2015 11:45:40 -0600
changeset 270658 e5f60475c16b0518fd226da2b5823a91bb7cd2a0
parent 270657 accf0dbda8bb6f8a4509078479ef50e0099060cb
child 270659 c16a007930e098fa8f9d0d60e71ca4a4939a98ea
push id29620
push usercbook@mozilla.com
push dateMon, 02 Nov 2015 10:56:37 +0000
treeherdermozilla-central@451a18579143 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersseth
bugs1219501
milestone45.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1219501. Limit total number of image decoding threads to 32 regardless of number asked for. r=seth
image/DecodePool.cpp
--- a/image/DecodePool.cpp
+++ b/image/DecodePool.cpp
@@ -341,16 +341,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");