Skip to content

Commit ad104c6

Browse files
committed
Correctly gard aginst failure when running on systems with 1 core
Motivation: 46b11cc did use Math.min(...) to guard while it has to be Math.max(...) Modifications: Use correct Math method Result: Fix problem when running on systems with 1 core. Fixes #14579
1 parent a16f8aa commit ad104c6

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

buffer/src/main/java/io/netty/buffer/AdaptivePoolingAllocator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ enum MagazineCaching {
109109
* This means the maximum amount of memory that we can have allocated-but-not-in-use is
110110
* 5 * {@link NettyRuntime#availableProcessors()} * {@link #MAX_CHUNK_SIZE} bytes.
111111
*/
112-
private static final int CENTRAL_QUEUE_CAPACITY = Math.min(2, SystemPropertyUtil.getInt(
112+
private static final int CENTRAL_QUEUE_CAPACITY = Math.max(2, SystemPropertyUtil.getInt(
113113
"io.netty.allocator.centralQueueCapacity", NettyRuntime.availableProcessors()));
114114

115115
/**

0 commit comments

Comments
 (0)