If we have multiple cores, leave one free from crypto tasks.

This commit is contained in:
akwizgran
2017-04-06 11:36:02 +01:00
parent d381e25e86
commit 3aa4644339
2 changed files with 2 additions and 2 deletions

View File

@@ -39,7 +39,7 @@ public class CryptoModule {
* The maximum number of executor threads.
*/
private static final int MAX_EXECUTOR_THREADS =
Runtime.getRuntime().availableProcessors();
Math.max(1, Runtime.getRuntime().availableProcessors() - 1);
private final ExecutorService cryptoExecutor;

View File

@@ -36,7 +36,7 @@ public class SyncModule {
* executor concurrently.
*/
private static final int MAX_CONCURRENT_VALIDATION_TASKS =
Runtime.getRuntime().availableProcessors();
Math.max(1, Runtime.getRuntime().availableProcessors() - 1);
@Provides
GroupFactory provideGroupFactory(CryptoComponent crypto) {