This is an automated email from the ASF dual-hosted git repository.
sijie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/bookkeeper.git
The following commit(s) were added to refs/heads/master by this push:
new 0988e12 ISSUE #2023: change cached thread pool to fixed thread pool
0988e12 is described below
commit 0988e12c7a12e1ffae2cdbe932ba414ec06f40cc
Author: bd2019us <[email protected]>
AuthorDate: Tue Apr 2 13:35:23 2019 -0500
ISSUE #2023: change cached thread pool to fixed thread pool
Descriptions of the changes in this PR:
change newCachedThreadPool() to newFixedThreadPool(int)
### Motivation
newFixedThreadPool(int) can be freely configured with the total number of
threads, while cached thread pool may cause OutOfMemoryError when there are too
many threads need to created.
Reviewers: Enrico Olivelli <[email protected]>, Sijie Guo
<[email protected]>
This closes #2024 from bd2019us/patch, closes #2023
---
.../main/java/org/apache/bookkeeper/tools/perf/table/PerfClient.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git
a/tools/perf/src/main/java/org/apache/bookkeeper/tools/perf/table/PerfClient.java
b/tools/perf/src/main/java/org/apache/bookkeeper/tools/perf/table/PerfClient.java
index 4b34427..835f816 100644
---
a/tools/perf/src/main/java/org/apache/bookkeeper/tools/perf/table/PerfClient.java
+++
b/tools/perf/src/main/java/org/apache/bookkeeper/tools/perf/table/PerfClient.java
@@ -324,7 +324,7 @@ public class PerfClient implements Runnable {
final CountDownLatch latch = new
CountDownLatch(tasks.size());
@Cleanup("shutdown")
- ExecutorService executor = Executors.newCachedThreadPool();
+ ExecutorService executor =
Executors.newFixedThreadPool(tasks.size());
for (BenchmarkTask task : tasks) {
executor.submit(() -> {
try {