summaryrefslogtreecommitdiffstats
path: root/core/java/android/webkit/WebView.java
diff options
context:
space:
mode:
authorRomain Guy <romainguy@google.com>2013-08-09 16:09:44 -0700
committerRomain Guy <romainguy@google.com>2013-08-09 16:15:18 -0700
commit719c44e03b97e850a46136ba336d729f5fbd1f47 (patch)
treeca328754d89329cf072ad2dbf8e6c660251c82dc /core/java/android/webkit/WebView.java
parentd81a15c6b77c94109d0a08bc7355f62301fe9234 (diff)
downloadframeworks_base-719c44e03b97e850a46136ba336d729f5fbd1f47.zip
frameworks_base-719c44e03b97e850a46136ba336d729f5fbd1f47.tar.gz
frameworks_base-719c44e03b97e850a46136ba336d729f5fbd1f47.tar.bz2
Prevent AsyncTask from creating too many threads
Bug #10228005 From the ThreadPoolExecutor documentation: - If fewer than corePoolSize threads are running, the Executor always prefers adding a new thread rather than queuing. - If corePoolSize or more threads are running, the Executor always prefers queuing a request rather than adding a new thread. - If a request cannot be queued, a new thread is created unless this would exceed maximumPoolSize, in which case, the task will be rejected. Before this change AsyncTask could create up to 128 threads because of the limited queue of 10 items (the capacity of a blocking queue is fixed.) This change increases the size of the queue to 128 items and reduces the maximum number of threads to the number of CPU cores * 2 + 1. Apps can still submit the same number of tasks. Change-Id: I015d77b53b6a9fda39c618830b34d45a10de5571
Diffstat (limited to 'core/java/android/webkit/WebView.java')
0 files changed, 0 insertions, 0 deletions