Thanks to visit codestin.com
Credit goes to github.com

Skip to content

AdaptivePoolingAllocator fails in an environment with less than 2 reported CPU's #14579

@kolstae

Description

@kolstae

Load class io.netty.buffer.ByteBufUtil in an environment with less than 2 CPU's.

Actual behavior

Fails with java.lang.IllegalArgumentException: capacity: 1 (expected: >= 2)

Steps to reproduce

In an environment with less than 2 CPU's run the below

Minimal yet complete reproducer code (or URL to code)

public static void main(String[] args) {
   io.netty.buffer.UnpooledByteBufAllocator.DEFAULT.directBuffer(16, 32);
}

Netty version

4.2.0.Beta1

JVM version (e.g. java -version)

openjdk version "21.0.3" 2024-04-16 LTS
OpenJDK Runtime Environment (build 21.0.3+10-LTS)
OpenJDK 64-Bit Server VM (build 21.0.3+10-LTS, mixed mode, sharing)

OS version (e.g. uname -a)

6.12.1-arch1-1 #1 SMP PREEMPT_DYNAMIC Fri, 22 Nov 2024 16:04:27 +0000 x86_64 GNU/Linux

Seems to be caused by io.netty.buffer.AdaptivePoolingAllocator.CENTRAL_QUEUE_CAPACITY being set equal to available CPU's.

Initially reported in vertx

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions