Skip to content

Commit

Permalink
change pool size
Browse files Browse the repository at this point in the history
  • Loading branch information
mopemope committed Apr 26, 2019
1 parent 1886e37 commit 548191a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion server/src/main/java/meghanada/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public static String getVersion() throws IOException {
}

public static void main(String[] args) throws ParseException, IOException {
int size = Runtime.getRuntime().availableProcessors() + 4;
int size = Runtime.getRuntime().availableProcessors() * 2;
System.setProperty(
"java.util.concurrent.ForkJoinPool.common.parallelism", Integer.toString(size));

Expand Down
4 changes: 2 additions & 2 deletions server/src/main/java/meghanada/system/Executor.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@
public class Executor {

private static final Logger log = LogManager.getLogger(Executor.class);
private static final int PARALLELISM = 8;

private static Executor executor;
private final ExecutorService executorService;
private final ExecutorService fixedThreadPool;
private final EventBus eventBus;

private Executor() {
int size = Runtime.getRuntime().availableProcessors() * 2;
this.executorService = Executors.newCachedThreadPool();
this.fixedThreadPool = Executors.newFixedThreadPool(PARALLELISM);
this.fixedThreadPool = Executors.newFixedThreadPool(size);
this.eventBus =
new AsyncEventBus(
executorService,
Expand Down

0 comments on commit 548191a

Please sign in to comment.