Skip to content

Commit e5231af

Browse files
committed
Limit nr of threads
1 parent b1a6c59 commit e5231af

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/test/java/com/mapcode/EncodeDecodeTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ private static void doEncodeDecode(final long seed) throws InterruptedException
6060
final AtomicInteger errors = new AtomicInteger(0);
6161
final AtomicInteger tasks = new AtomicInteger(0);
6262

63-
final int threads = Runtime.getRuntime().availableProcessors() * 2;
63+
final int threads = Math.min(Runtime.getRuntime().availableProcessors() * 2, 8);
6464
LOG.info("encodeDecodeTest: Starting {} threads...", threads);
6565
final ExecutorService executor = Executors.newFixedThreadPool(threads);
6666

0 commit comments

Comments
 (0)