Skip to content

[BUG]In the Windows development environment, after running for a period of time, the CPU reaches 100% #1447

Closed as not planned
@H-Dynamite

Description

@H-Dynamite

What is the bug?

A clear and concise description of the bug.

I have been experiencing an issue where, after running my application for some time, the CPU usage spikes to 100%. This problem has been persistent and is quite frustrating. I suspect it might be related to JDK NIO polling, but I haven't been able to pinpoint the exact cause.

How can one reproduce the bug?

Steps to reproduce the behavior.

pom.xml

    <dependency>
      <groupId>org.opensearch.client</groupId>
      <artifactId>opensearch-java</artifactId>
      <version>2.21.0</version>
    </dependency>

    <dependency>
      <groupId>org.apache.httpcomponents.client5</groupId>
      <artifactId>httpclient5</artifactId>
      <version>5.4.2</version>
    </dependency>

Image

    public static void main(String[] args) throws NoSuchAlgorithmException, KeyStoreException, KeyManagementException, IOException, InterruptedException {
        var client = SampleClient.create();
        var version = client.info().version();
        System.out.println("version = " + version);
        while (true){
            Thread.sleep(5000);
        }
    }

What is your host/environment?

Operating system, version.

Environment:

Development Environment: IntelliJ IDEA

Operating System: Windows 11 CPU 13th Gen Intel(R) Core(TM) i7-13700,2100 Mhz 32GRAM

JDK: Amazon Corretto 11.0.21

This is the result of using IDEA performance analysis

Image

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions